I'm beginer. I'm designing a website about furniture. But I face some problem with css and bootstrap. I think they are conflicted.
I want to design a table which contain some contents and pictures. They can lead another page's this website. I tried to do my best but they don't work.maybe my program is not good. sorry for this inconvenience!. Can you tell me how to make table? thanks a million.
#charset "utf-8";
/* CSS Document */
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
body{
font-family: Arial;
background-color: darkgrey;
}
.topnav{
position: relative;
margin: 0 auto;
z-index: 1;
}
.topnav .content{
position: absolute;
top: 0;
background: rgba(0,0,0,0.5);
width: 100%;
color: #f1f1f1;
padding: 20px;
animation-duration: 0s;
}
.topnav a{
float:left;
display: inline-block;
color: white;
text-align: center;
padding: 15px 15px;
text-decoration: none;
font-size: 14px;
margin-left: 150px;
}
.topnav a:hover{
background-color: white;
color: white;
background: rgba(0,0,0,0.5);
}
.topnav .search-container{
float: right;
margin-right: 120px;
}
.topnav input[type=text]{
padding: 6px;
margin-top: 8px;
font-size: 15px;
border: 2px solid ghostwhite;
}
.topnav .search-container button{
float: right;
padding: 6px 10px;
margin-top: 8px;
background-color: white;
border: none;
cursor: pointer;
}
.top .search-container button:hover{
background-color: white;
color: black;
}
#media screen and (max-width: 600px){
.topnav .search-container {
float: none;
}
}
.topnav a, .top input[type=text], .topnav .search-container button {
float: none;
display: inline-block;
text-align: left;
margin: 0px;
padding: 14px;
}
.topnav input[type=text]{
border: 2px solid ghostwhite;
}
.topnav .logo{
float: left;
width: 70px;
height: 45px;
margin-right: 10px;
}
.mySlides {
display: none;
max-width: 100%;
}
.slideshow-container {
max-width: 100%;
position: relative;
margin: 0px;
background-size: cover;
background-repeat: no-repeat;
background-position: center;
height: 100%;
}
.text{
color: white;
font-size: 50px;
position: absolute;
text-align: center;
}
.hero-text{
text-align: center;
position:absolute;
top: 50%;
left: 50%;
color: white;
transform: translate(-50%, -50%);
background: rgb(0,0,0,0.3);
background-color: black;
opacity: 0.4;
z-index: 1;
}
.fade {
-webkit-animation-name: fade;
-webkit-animation-duration: 2.69s;
animation-name: fade;
animation-duration: 2.69s;
}
#-webkit-keyframes fade{
from{opacity: 0.5}
to{opacity: 1}
}
#keyframes fade{
from {opacity: 0.5}
to{opacity: 1}
}
#media only screen and (max-width: 320px){
.text {font-size: 30px;}
}
.container {
position: relative;
font-family: Arial;
}
.button{
color: white;
background-color: black;
cursor: pointer;
display: block;
fontsize: 20px;
font-weight: 400;
line-height: 45px;
margin: 2px auto 2em;
max-width: 160px;
position: relative;
text-decoration: none;
text-transform: uppercase;
vertical-align: middle;
letter-spacing: 0;
box-shadow: 3px 3px 1px;
}
.button:hover,
.button:active {
letter-spacing: 5px;
}
.button:after,
.button:before{
backface-visibility: hidden;
border: 1px solid white;
bottom: 0px;
content: " ";
display: block;
margin: 0 auto;
position: relative;
transition: all 280ms ease-in-out;
width: 0;
}
.button:hover:after,
.button:hover:before{
backface-visibility: hidden;
border-color: white;
transition: width 350ms ease-in-out;
width: 70%;
}
.button :hover:before{
bottom: auto;
top: 0;
width: 70%;
}
.dropdown{
float: left;
overflow: hidden;
}
.dropdown .dropbtn{
font-size: 14px;
border: none;
outline: none;
color: white;
padding: 14px 16px;
background: rgba(0,0,0,0.5);
}
.topnav a:hover, .dropdown: hover .dropbtn{
background-color: white;
color: black;
}
.dropdown-content{
display: none;
position: absolute;
background-color: #f9f9f9;
width: 100%;
left: 0;
}
.dropdown: hover .dropdown-content{
display: block;
}
.contain {
position:relative;
width: 50%;
}
.image{
opacity: 1;
display: block;
width: 90%;
height: auto;
transition: .5s ease;
backface-visibility: hidden;
margin-top: -30px;
border: 2px solid black;
box-shadow: 3px 3px 1px;
}
.middle{
transition: .5s ease;
opacity: 0.5;
position: absolute;
top: 50%;
left: 33%;
-ms-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
}
.contain:hover .image{
opacity: 0.3;
}
.contain:hover .image{
opacity: 1;
}
.text-con{
background-color: black;
color: white;
font-size: 16px;
padding: 16px 32px;
}
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style1.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<title>Quality Furnitures</title>
</head>
<body>
<div class="topnav">
<div class="content">
<img class="logo" src="image.css/logo.jpg">
HOME
PRODUCTION
PROJECTS
CONTACTS
<div class="search-container">
<input type="text" placeholder="Search..." name="search">
<buttton type="submit"><i class="fa fa-search"></i></buttton>
</div>
</div>
</div>
<div class="slideshow-container">
<div class="hero-text">
<h3 style="font-size: 60px"><u>Style.Luxury.Design</u></h3>
<br>
<button class="button"><strong>SHOP NOW</strong></button>
<button class="button"><strong>EXPLORE NOW</strong></button>
</div>
<div class="mySlides fade">
<div class="container">
<img src="image.css/161122_14_59_10_5DS_7049.0.jpg" style="width:100%; height:70%">
</div>
</div>
<div class="mySlides fade">
<div class="container">
<img src="image.css/top-interior-design-furniture-stores-home-decoration-ideas-designing-luxury-at-interior-design-furniture-stores-interior-design-ideas.jpg" style="width:100%; height:70%">
</div>
</div>
<div class="mySlides fade">
<div class="container">
<img src="image.css/luxury-furnature-stores-with-top-online-furniture-stores.jpg" style="width:100%; height: 70%">
</div>
</div>
</div>
<script>
var slideIndex;
function showSlides(){
var i;
var slides=document.getElementsByClassName("mySlides");
for (i=0; i<slides.length; i++){
slides[i].style.display ="none";
}
slides[slideIndex].style.display ="block";
slideIndex++;
if (slideIndex > slides.length -1){
slideIndex = 0;
}
setTimeout(showSlides, 5000);
}
showSlides(slideIndex =0);
function currentSlide(n){
showSlides(slideIndex = n);
}
</script>
<div class="row">
<div class="col-md-4">
<div class="thumbnail">
<div class="contain">
<img src="image.css/22staged1-master768.jpg" style="width:90%" class="image">
<br>
<div class="middle">
<div class="text-con">
<h2>Living Room</h2>
<br>
<button class="button">SEE MORE</button>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-4">
<div class="thumbnail">
<div class="contain">
<img src="image.css/eva_br.jpg" style="width:90%" class="image">
<div class="middle">
<div class="text-con">
<h2>BedRoom</h2>
<br>
<button class="button">SEE MORE</button>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-4">
<div class="thumnail">
<div class="contain">
<img src="image.css/bathroom.jpg" style="width: 90%" class="image">
<div class="middle">
<div class="text-con">
<h2>BathRoom</h2>
<br>
<button class="button">SEE MORE</button>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
You just need to change the order in which you are loading your stylesheets. Currently you are loading them in this order
<link rel="stylesheet" href="style1.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
You need to have your own styles come after the bootstrap style sheet
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="style1.css">
This is the cascade aspect of CSS (the 'C'). Your rules are currently being overwritten by bootstrap default rules and that is why you are having some conflicts. To better understand you can take a look here https://developer.mozilla.org/en-US/docs/Learn/CSS/Introduction_to_CSS/Cascade_and_inheritance
Related
I am making a website where people can watch videos and I want my videos to fit the screens on telephones but it wont fit. The widht does not want to change.
Here is my HTML:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Hamza</title>
<link rel="icon" href="profile.jpg">
<link rel="stylesheet" href="style.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://kit.fontawesome.com/e838428f0c.js" crossorigin="anonymous"></script>
</head>
<body>
<nav>
<ul>
<a class="hamxa" href="index.html">
<center>
<img class="profile-pic-1" src="profile.jpg">
</center>
<h1 class="hamza">Hamza</h1>
</a>
<div class="items">
<a href="videos.html">
<button><i class="fa-solid fa-circle-play"></i>VIDEOS</button>
</a>
<a href="https://docs.google.com/forms/d/e/1FAIpQLSc4uB40mPR_idarZm--J8_0iM3je3ipRw4wY_L9Ka_pqYMQPg/viewform">
<button><i class="fa-solid fa-briefcase"> WORK</i></button>
</a>
</div>
</ul>
</nav>
<p></p>
<div class="container">
<div class="video-container">
<div>
<div class="video"><video poster="welcome.jpg" src="Video1.mp4"></video></div>
<p>Welcome To The Cult.</p>
</div>
</div>
<h2>New Videos</h2>
<div class="video-container">
<div>
<div class="video"><video poster="Video1.jpg" src="Video1.mp4"></video></div>
<p>BECOME THE STRONG MAN THEY NEED / TESTOSTERONE IS AT ALL TIME LOW</p>
</div>
<div>
<div class="video"><video poster="Video2.jpg" src="Video1.mp4"></video></div>
<p>7 Reasons People Dislike You Immediately</p>
</div>
<div>
<div class="video"><video poster="Video3.jpg" src="Video1.mp4"></video></div>
<p>PSYCHOLOGICAL SECRETS OF ATTRACTION</p>
</div>
</div>
<div class="popup-video">
<span>×</span>
<video src="Video1.mp4" autoplay controls></video>
</div>
</div>
<script>
document.querySelectorAll('.video-container video').forEach(vid =>{
vid.onclick = () =>{
document.querySelector('.popup-video').style.display = 'block';
document.querySelector('.popup-video video').src = vid.getAttribute('src')
}
});
document.querySelector('.popup-video span').onclick = () =>{
document.querySelector('.popup-video').style.display = 'none';
document.querySelector('.popup-video video').src = 'none';
}
</script>
</body>
</html>
Here is my CSS:
#import url('https://fonts.googleapis.com/css2?family=Josefin+Sans:wght#500&display=swap');
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Josefin Sans', sans-serif;
text-align: center;
}
h1 {
color: white;
}
h2 {
margin: 30px;
text-decoration: underline;
}
a {
color: black;
margin: 0;
font-size: 18px;
font-weight: 700;
line-height: 20px;
margin-bottom: 12px;
margin-left: 12px;
text-align: left;
text-decoration: none;
max-width: 100%;
}
p {
width: 437px;
font-size: 18px;
margin-top: 20px;
}
nav {
background: #222222;
border: 1px solid #222222;
border-right: none;
border-left: none;
}
ul {
padding: 0;
margin: 0;
}
button {
padding: 0;
border: none;
background: #222222;
color: white;
width: 100px;
height: 50px;
}
button:hover {
padding: 0;
background: white;
border: none;
color: black;
width: 100px;
height: 50px;
border-radius: 5px;
transition: 0.25s;
}
center {
margin-bottom: 30px;
}
textarea {
height: 20px;
width: 100%;
border: none;
border-bottom: 2px solid #aaa;
background-color: transparent;
margin-bottom: 10px;
resize: none;
outline: none;
transition: .5s;
}
i {
padding-right: 5px;
}
.items {
margin-bottom: 30px;
}
.profile-pic-1 {
width: 100px;
border-radius: 100px;
}
.profile-pic-1:hover {
opacity: 0.75;
transition: 0.25s;
}
.hamza {
margin-bottom: 30px;
margin-top: 0;
text-align: center;
}
.hamza:hover {
opacity: 0.75;
transition: 0.25s;
}
.container {
position: relative;
min-height: 100vh;
}
.container .video-container {
display: flex;
flex-wrap: wrap;
gap: 15px;
justify-content: center;
padding: 10px;
}
.container .video-container .video {
height: 250px;
width: 437px;
border: 5px solid white;
border-radius: 5px;
box-shadow: 0 5px 15px rgba(0, 0, 0, .7);
cursor: pointer;
overflow: hidden;
}
.container .video-container .video video {
height: 100%;
width: 100%;
object-fit: cover;
transition: .2s linear;
}
.container .video-container .video:hover video {
transform: scale(1.1);
}
.container .popup-video {
position: fixed;
top: 0;
left: 0;
z-index: 100;
background: rgba(0, 0, 0, 0.8);
height: 100%;
width: 100%;
display: none;
}
.container .popup-video video {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 750px;
border-radius: 5px;
border: 3px solid white;
object-fit: cover;
}
.container .popup-video span {
position: absolute;
top: 5px;
right: 20px;
font-size: 50px;
color: white;
font-weight: bold;
z-index: 100;
cursor: pointer;
}
#media (max-width: 768px){
.container .popup-video video {
width: 95%;
}
}
I have tried to change the width of the videos but it does not work. And i have no idea what to do. I am new to programing.
I'm a beginner in html and I want to learn. Three days ago I started my html journey and I'm running into a problem...
So, I created a 'dark-mode' theme on my page and it's working.
My problem is: when I click the Theme button, I want to change the search bar color and text and I don't know how to do it.
Basically when I click the Theme button to change theme to dark mode I want the search bar to change background color to #121212 and text color to white.
And when I re-click the Theme button and come back to light mode, to undo the things, but I can't figure out how.
Thank you in advance.
<!DOCTYPE html>
<html>
<head>
<title>Test</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Raleway">
<style>
body {
background-color: white;
color: #369497;
transition: 0.5s;
}
.dark-mode {
background-color: #121212;
color: white;
transition: 0.5s;
}
.button {
display: inline-block;
border-radius: 4px;
background-color: #369497;
border: none;
color: white;
text-align: center;
font-size: 18px;
padding: 12px;
width: 120px;
transition: all 0.5s;
cursor: pointer;
margin: 10px;
}
.button-pos {
margin: 0;
position: absolute;
bottom: 0%;
right: 0%;
transform: translate(-20%, -15%);
}
.button span {
cursor: pointer;
display: inline-block;
position: relative;
transition: 0.5s;
}
.button span:after {
content: '\00bb';
position: absolute;
opacity: 0;
top: 0;
right: -20px;
transition: 0.5s;
}
.button:hover span {
padding-right: 25px;
}
.button:hover span:after {
opacity: 1;
right: 0;
}
input[type=text] {
width: 480px;
box-sizing: border-box;
border: 2px solid #369497;
border-radius: 4px;
font-size: 16px;
background-color: white;
padding: 12px 20px 12px 10px;
}
.searchbar-pos {
margin: 0;
position: absolute;
top: 25%;
left: 25%;
}
</style>
</head>
<body>
<div class="bgimg w3-display-container w3-animate-opacity">
<div class="w3-display-topmiddle">
<img src="logo" alt="logo">
</div>
</div>
<div class="bgimg w3-display-container w3-animate-opacity">
<div class="w3-display-topleft w3-padding-large w3-xlarge">
Logo
</div>
</div>
<script>
function myFunction() {
var element = document.body;
element.classList.toggle("dark-mode");
}
</script>
<div class="w3-animate-opacity">
<div class="button-pos">
<button onclick="myFunction()" class="button" style="vertical-align:middle"><span>Theme </span></button>
</div>
</div>
<div class="searchbar-pos">
<form>
<input type="text" name="search" placeholder="Search...">
</form>
</div>
</body>
</html>
You have to write a css rule for that, basically something that overrides the input styling when there's a parent element with dark-mode class applied (body in this case).
All you need is ti add this to your css:
.dark-mode input[type=text] {
background-color: #121212;
color: white;
}
Here's your code with that change:
<!DOCTYPE html>
<html>
<head>
<title>Test</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Raleway">
<style>
body {
background-color: white;
color: #369497;
transition: 0.5s;
}
.dark-mode {
background-color: #121212;
color: white;
transition: 0.5s;
}
.button {
display: inline-block;
border-radius: 4px;
background-color: #369497;
border: none;
color: white;
text-align: center;
font-size: 18px;
padding: 12px;
width: 120px;
transition: all 0.5s;
cursor: pointer;
margin: 10px;
}
.button-pos {
margin: 0;
position: absolute;
bottom: 0%;
right: 0%;
transform: translate(-20%, -15%);
}
.button span {
cursor: pointer;
display: inline-block;
position: relative;
transition: 0.5s;
}
.button span:after {
content: '\00bb';
position: absolute;
opacity: 0;
top: 0;
right: -20px;
transition: 0.5s;
}
.button:hover span {
padding-right: 25px;
}
.button:hover span:after {
opacity: 1;
right: 0;
}
input[type=text] {
width: 480px;
box-sizing: border-box;
border: 2px solid #369497;
border-radius: 4px;
font-size: 16px;
background-color: white;
padding: 12px 20px 12px 10px;
}
.dark-mode input[type=text] {
background-color: #121212;
color: white;
}
.searchbar-pos {
margin: 0;
position: absolute;
top: 25%;
left: 25%;
}
</style>
</head>
<body>
<div class="bgimg w3-display-container w3-animate-opacity">
<div class="w3-display-topmiddle">
<img src="logo" alt="logo">
</div>
</div>
<div class="bgimg w3-display-container w3-animate-opacity">
<div class="w3-display-topleft w3-padding-large w3-xlarge">
Logo
</div>
</div>
<script>
function myFunction() {
var element = document.body;
element.classList.toggle("dark-mode");
}
</script>
<div class="w3-animate-opacity">
<div class="button-pos">
<button onclick="myFunction()" class="button" style="vertical-align:middle"><span>Theme </span></button>
</div>
</div>
<div class="searchbar-pos">
<form>
<input type="text" name="search" placeholder="Search...">
</form>
</div>
</body>
</html>
This question already has answers here:
What methods of ‘clearfix’ can I use?
(29 answers)
What is a clearfix?
(10 answers)
Closed 2 years ago.
I have a problem with my footer.
I know, that the problem is in float: left in style for div with light-blue borders (.card). I need to set footer in the end of the page.
Result
CSS/HTML code:
body {
font-family: arial;
/*меняем шрифт*/
}
.dropbtn {
text-decoration: none;
/*убираем подчеркивание текста ссылок*/
border: 3px solid #30A8E6;
color: mediumslateblue;
/*меняем цвет ссылок*/
background: white;
padding: 10px;
/*добавляем отступ*/
border-radius: 4px;
/*добавляем скругление*/
-moz-transition: all 0.3s 0.01s ease;
/*делаем плавный переход*/
-o-transition: all 0.3s 0.01s ease;
-webkit-transition: all 0.3s 0.01s;
margin-top: 20px;
margin-right: 10px;
font-size: 18px;
}
button:hover {
background: #1C85BB;
/*добавляем эффект при наведении*/
color: white;
}
#menu {
margin: 0 auto;
width: 100%;
text-align: center;
}
#logo {
width: 250px;
height: 170px;
}
#header {
width: 1000px;
height: 200px;
background: url("img/header.jpg") no-repeat;
margin: 0 auto;
border: 2px solid black;
display: flex;
align-items: center;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #f1f1f1;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
z-index: 1;
}
.dropdown-content a {
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
}
.dropdown-content a:hover {
background-color: #ddd;
}
.dropdown:hover .dropdown-content {
display: block;
}
.sidenav {
display: inline-block;
width: 150px;
position: fixed;
z-index: 1;
vertical-align: middle;
left: 10px;
background: #eee;
overflow-x: hidden;
padding: 8px 0;
}
.sidenav a {
padding: 6px 8px 6px 16px;
text-decoration: none;
font-size: 25px;
color: #2196F3;
display: block;
}
.sidenav a:hover {
color: #064579;
text-decoration: underline #2196F3;
}
.main {
margin-left: 200px;
margin-right: 250px;
font-size: 40px;
padding: 0px 10px;
margin-top: 50px;
}
#media screen and (max-height: 450px) {
.sidenav {
padding-top: 15px;
}
.sidenav a {
font-size: 18px;
}
}
/*old styles*/
.footer {
background: blue;
height: 250px;
position: fixed;
/* Фиксированное положение */
left: 0;
bottom: 0;
/* Левый нижний угол */
padding: 10px;
/* Поля вокруг текста */
color: #fff;
/* Цвет текста */
width: 100%;
/* Ширина слоя */
}
.menu-footer {
list-style-type: none;
}
.menu-footer a {
text-decoration: underline;
color: white;
}
/*cards from main*/
.card {
float: left;
width: 300px;
height: 300px;
border: 2px solid cornflowerblue;
border-radius: 5%;
margin-right: 20px;
margin-top: 25px;
}
.sideDrop {
-moz-transition: all 0.3s 0.01s ease;
/*делаем плавный переход*/
-o-transition: all 0.3s 0.01s ease;
-webkit-transition: all 0.3s 0.01s;
}
.img-card {
width: 296px;
height: 210px;
border-radius: 5%;
}
.main-footer {
position: absolute;
top: 0;
left: 0;
}
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<title>Авто+</title>
<link rel="stylesheet" type="text/css" href="styles.css">
<link rel="stylesheet" type="text/css" href="form-style.css">
</head>
<body>
<div id="header">
<img id="logo" src="img/logo.png" alt="Логотип">
</div>
<div id="menu">
<button class="dropbtn"><b>Главная</b></button>
<button class="dropbtn"><b>Услуги</b></button>
<button class="dropbtn"><b>Цены</b></button>
</div>
<div class="form" style="">
<form action="" class="ui-form">
<h3>Обратная связь</h3>
<div class="form-row">
<input type="text" id="phone" required autocomplete="off"><label for="phone">Номер телефона</label>
</div>
<p><input type="submit" value="Отправить"></p>
</form>
</div>
<div class="sidenav">
Категории
<div class="dropdown-content">
Все
Легковаые
Грузовые
Мотоциклы
</div>
</div>
<!--Main part cards-->
<div class="main">
<div class="card">
<img class="img-card" src="img/bmw1.jpg">
</div>
<div class="card">
</div>
<div class="card">
</div>
<div class="card">
</div>
<div class="card">
</div>
<div class="card">
</div>
<div class="card">
</div>
<div class="card">
</div>
</div>
<!--<div class="footer">-->
<!-- <ul style="padding: 70px 0px 0px 70px">-->
<!-- <li class="menu-footer">-->
<!-- <p>Главная</p>-->
<!-- </li>-->
<!-- <li class="menu-footer">-->
<!-- <p>Услуги</p>-->
<!-- </li>-->
<!-- <li class="menu-footer">-->
<!-- <p>Цены</p>-->
<!-- </li>-->
<!-- </ul>-->
<!--</div>-->
<!--footer-->
<footer style="width: 100%; height: 50px; background: darkslategray; bottom: 0;">
</footer>
</div>
</body>
</html>
You can add "clear: both" to the footer css.
My website responsive works on my iPhone 100% but for some reason it messes up on android devices...
I've already got bootstrap integrated with it's suggested responsive string.
How it should look: http://prntscr.com/p4szot <-- iPhone
The main problem: http://prntscr.com/p4szg4 <-- Android
I've installed bootstrap and it's responsive strings.
I've added the style property word-break: break-all;
<html lang="en">
<head>
<title>Semix | Cheap Website Development</title>
<!--Font awsome---------------------------------------------------------------------------------->
<script src="https://kit.fontawesome.com/3c0298f6a8.js"></script>
<!--Google Fonts--------------------------------------------------------------------------------->
<link href="https://fonts.googleapis.com/css?family=Open+Sans&display=swap" rel="stylesheet">
<!--Stylesheet----------------------------------------------------------------------------------->
<link rel=stylesheet href="style.css" type="text/css" media="screen">
<!--Bootstrap------------------------------------------------------------------------------------>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
</head>
<body>
<div class="container">
<nav>
<input type="checkbox" id="nav" class="hidden">
<label for="nav" class="nav-btn">
<i></i>
<i></i>
<i></i>
</label>
<div class="logo">
<img class="logo" src="images/logow.png">
</div>
<div class="nav-wrapper">
<ul>
<li><a class="active"href="index.html">Home</a></li>
<li>Pricing</li>
<li>faq</li>
<li>Contact</li>
</ul>
</div>
</nav>
</div>
<!--TODO Header Content-->
<div class="header">
<h1>Website development<br> made easy</h1>
<h3>Not just a business but a reliable business partner</h3>
<button type="button" class="button button-1">get started</button>
<button type="button" class="button button-2">get a quote</button>
</div>
<!-- TODO Sub Content-->
<div class="sub-content">
<h2>Professional website development</h2>
<p>Semix is a professional website & graphics development company based in South Africa, we can offer modern creative and responsive designs to best suit your needs.</p>
</div>
<!--TODO Services-->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
</body>
<div class="services-section">
<div class="inner-width">
<h1 class="section-title">Our Services</h1>
<div class="border"></div>
<div class="services-container">
<div class="service-box">
<div class="service-icon">
<i class="fas fa-wrench"></i>
</div>
<div class="service-title">Technical Support</div>
<div class="service-desc">
Problem with your site? Hosting? We will help you setup your site with the correct hosting plans and domain registration
</div>
</div>
<div class="service-box">
<div class="service-icon">
<i class="fas fa-code"></i>
</div>
<div class="service-title">Web Development</div>
<div class="service-desc">
We create beautiful and functional websites with responsive designs to ensure our work looks great on any device
</div>
</div>
<div class="service-box">
<div class="service-icon">
<i class="fas fa-brush"></i>
</div>
<div class="service-title">Live chat / email</div>
<div class="service-desc">
Make sure your business never sleeps by integrating a contact form and live chat with automatic replies to your amazing site
</div>
</div>
<div class="service-box">
<div class="service-icon">
<i class="fas fa-headset"></i>
</div>
<div class="service-title">Support</div>
<div class="service-desc">
We have amazing support to make sure we can help you in any way possible
</div>
</div>
<div class="service-box">
<div class="service-icon">
<i class="fab fa-searchengin"></i>
</div>
<div class="service-title">SEO</div>
<div class="service-desc">
Search Engine Optimization, make sure your website is being discovered and displayed on Google search results
</div>
</div>
<div class="service-box">
<div class="service-icon">
<i class="fas fa-file-code"></i>
</div>
<div class="service-title">Custom Work</div>
<div class="service-desc">
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Et eaque ratione rem porro, nihil.
</div>
</div>
</div>
</div>
</div>
<!--TODO button section-->
<div class="button-section">
<button type="button" class="button button-3">Start Your Project</button>
</div>
<div class="footer">
<p>© Copyright Semix 2019</p>
<div class="footer-nav">
Legal|
Terms|
FAQ|
Contact
</div>
<h2>Semix</h2> <img src="images/south-africa.png" alt="sa-logo">
</div>
</html>
body {
font-family: 'Open sans', sans-serif;
height: 100%;
margin: 0;
background: url(images/main-background-header.png);
background-position: center;
background-color: black;
background-repeat: no-repeat;
}
html{
height: 100%;
margin: 0;
padding: 0;
width: 100%,
}
*{
margin:0;
padding:0;
box-sizing: border-box;
word-break: break-all;
}
/*Header*/
.image{
background-position: center;
height: calc(100% + 700px);
width:100%;
background-repeat: no-repeat;
position: absolute;
z-index:-1;
top: -80px;
text-align: center;
}
.header > h1{
font-family: 'Open sansextra-bold', sans-serif;
text-align: center;
font-size: 60px;
text-transform: uppercase;
color: white;
}
.header > h3{
font-family: 'Open sans', sans-serif;
text-align: center;
color: #828282;
}
.header{
position:relative;
text-align:center;
color:white;
padding:10px 0px;
margin-top: 200px;
}
.button {
border: none;
padding: 16px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 20px;
text-transform: uppercase;
-webkit-transition-duration: 0.4s;
transition-duration: 0.4s;
cursor: pointer;
display: inline-block;
flex-direction: column;
justify-content: center;
margin-top: 50px;
}
.button-1 {
background-color: transparent;
color: white;
border: 3px solid white;
text-align: center;
}
.button-2{
background-color: #FF4E00;
color: white;
border: 3px solid #FF4E00;
}
.button-1:hover{
background-color:white;
color: black;
border: 3px solid white;
}
/*Our Services Section*/
.services-section{
background: url(images/services.jpg);
background-size: cover;
padding: 60px 0;
}
.inner-width{
width: 100%;
max-width: 1200px;
margin: auto;
padding: 0 20px;
overflow: hidden;
}
.section-title{
text-align: center;
color: #ddd;
text-transform: uppercase;
font-size: 30px;
}
.border{
width: 160px;
height: 2px;
background: #FF4E00;
margin: 40px auto;
}
.services-container{
display: flex;
flex-wrap: wrap;
justify-content: center;
}
.service-box{
max-width: 33.33%;
padding: 10px;
text-align: center;
color: #ddd;
cursor: pointer;
}
.service-icon{
display: inline-block;
width: 70px;
height: 70px;
border: 3px solid #FF4E00;
color: #fff;
transform: rotate(45deg);
margin-bottom: 30px;
margin-top: 16px;
transition: 0.3s linear;
}
.service-icon i{
line-height: 70px;
transform: rotate(-45deg);
font-size: 26px;
}
.service-box:hover .service-icon{
background: #FF4E00;
color: #ddd;
}
.service-title{
font-size: 18px;
text-transform: uppercase;
margin-bottom: 10px;
}
.service-desc{
font-size: 14px;
}
#media screen and (max-width:960px) {
.service-box{
max-width: 45%;
}
}
#media screen and (max-width:768px) {
.service-box{
max-width: 50%;
}
}
#media screen and (max-width:480px) {
.service-box{
max-width: 100%;
}
}
/*NEW NAV*/
nav {
padding: 8px;
display: inline;
}
.logo {
float: left;
padding: 8px;
margin-left: 16px;
margin-top: 8px;
width: 250px;
height: 70px;
}
nav ul{
float: right;
}
nav ul li {
display: inline-block;
}
nav ul li:not(:first-child) {
margin-left: 48px;
}
nav a.active{
font-weight: bold;
color: #FF4E00;
}
nav ul li:last-child {
margin-right: 24px;
}
nav ul li a {
display: inline-block;
outline: none;
color: white;
text-transform: uppercase;
text-decoration: none;
font-size: 15px;
}
#media screen and (max-width: 864px) {
.logo {
padding: 0;
width: 100px;
height: auto !important;
}
.header{
margin-top: 100px;
}
.header h1{
font-size: 20px;
}
.header h3{
font-size: 17px;
}
.nav-wrapper {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: -1;
background: #fff;
opacity: 0;
transition: all 0.2s ease;
}
.nav-wrapper ul {
position: absolute;
top: 50%;
transform: translateY(-50%);
width: 100%;
}
.nav-wrapper ul li {
display: block;
float: none;
width: 100%;
text-align: right;
margin-bottom: 10px;
}
.nav-wrapper ul li:nth-child(1) a {
transition-delay: 0.2s;
}
.nav-wrapper ul li:nth-child(2) a {
transition-delay: 0.3s;
}
.nav-wrapper ul li:nth-child(3) a {
transition-delay: 0.4s;
}
.nav-wrapper ul li:nth-child(4) a {
transition-delay: 0.5s;
}
.nav-wrapper ul li:nth-child(5) a {
transition-delay: 0.6s;
}
.nav-wrapper ul li:not(:first-child) {
margin-left: 0;
}
.nav-wrapper ul li a {
padding: 10px 24px;
opacity: 0;
color: #000;
font-size: 14px;
font-weight: 600;
letter-spacing: 1.2px;
transform: translateX(-20px);
transition: all 0.2s ease;
}
.nav-btn {
position: fixed;
right: 10px;
top: 10px;
display: block;
width: 48px;
height: 48px;
cursor: pointer;
z-index: 9999;
border-radius: 50%;
}
.nav-btn i {
display: block;
width: 20px;
height: 2px;
background:white;
border-radius: 2px;
margin-left: 14px;
}
.nav-btn i:nth-child(1) {
margin-top: 16px;
}
.nav-btn i:nth-child(2) {
margin-top: 4px;
opacity: 1;
}
.nav-btn i:nth-child(3) {
margin-top: 4px;
}
}
#nav:checked + .nav-btn {
transform: rotate(45deg);
}
#nav:checked + .nav-btn i {
background: #000;
transition: transform 0.2s ease;
}
#nav:checked + .nav-btn i:nth-child(1) {
transform: translateY(6px) rotate(180deg);
}
#nav:checked + .nav-btn i:nth-child(2) {
opacity: 0;
}
#nav:checked + .nav-btn i:nth-child(3) {
transform: translateY(-6px) rotate(90deg);
}
#nav:checked ~ .nav-wrapper {
z-index: 9990;
opacity: 1;
}
#nav:checked ~ .nav-wrapper ul li a {
opacity: 1;
transform: translateX(0);
}
.hidden {
display: none;
}
.sub-content {
background: #FF4E00;
min-height: 200px;
margin-top: 90px;
text-align: center;
position: relative;
font-family: 'Open sans', sans-serif;
}
.sub-content h2{
color: white;
font-size: 30px;
padding-top: 30px;
text-transform: uppercase;
}
.sub-content p{
color: white;
padding-top: 30px;
}
.button-3 {
background-color: white;
color: black;
border: 3px solid white;
text-align: center;
justify-content: center;
}
.button-3:hover {
background-color: white;
color: black;
border: 3px solid rgb(209, 63, 0);
text-align: center;
justify-content: center;
}
.button-section{
background-color: #FF4E00;
justify-content: center;
position:relative;
text-align:center;
padding-bottom: 50px;
}
.footer{
background-color: #000;
color: white;
text-align: center;
padding-top: 50px;
padding-bottom: 50px;
}
.footer h2{
padding-top: 30px;
}
.footer-nav {
justify-content: center;
text-align: center;
padding-top: 20px;
}
.footer-nav a {
text-decoration: none;
color: white;
padding: 20px;
text-transform: uppercase;
}
#media screen and (max-width: 864px) {
.sub-content h2{
font-size: 20px;
}
}
The issue is that the <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> is in the wrong spot in your HTML.
This tag needs* to be one of the first tags inside the <head> and before the <title> tag and any CSS.
I believe this is because the meta tag is telling the browser how to interpret style properties that would come from #media queries (among other things).
Here is the spec:
https://drafts.csswg.org/css-device-adapt/#viewport-meta
This offers some good info on what the browser should do with the tag, which may lead to some inference to why it behaves the way it does.
*Need documentation to support this vs. this is how it works without breaking.
I have nav menu you can look at the snippet. (its not responsive in this case). And my problem is that i want to make searchbar (on hover with page max-width980px) to hide all elements and to be full width in nav menu. Problem is that i have very poor understanding of javascript so if is there any css only solution. I tried adding z-index but without effect.
/* Navigation menu */
.resmenu {
display: none;
cursor: pointer;
}
.resmenuitems {
display: none;
}
.navmenu {
width: 100%;
height: 55px;
border-bottom: 1px solid rgb(240,240,240);
}
.logo {
color: black;
display: flex;
justify-content: center;
align-items: center;
width: 100px;
height: 100%;
font-size: 1.5em;
font-weight: bold;
float: left;
margin-left: 3%;
padding: 10px 0px 10px 0px;
}
.navlinksr {
float: right;
margin-right: 2%;
width: 490px;
height: 100%;
display: flex;
align-items: center;
justify-content:space-around;
}
.navlinksr a {
float: right;
text-decoration: none;
color: black;
font-size: 0.95em;
font-family: 'Roboto', sans-serif;
font-weight: bold;
}
.navlinksline {
height: 40%;
width: 1px;
background-color: grey;
}
.logodif {
background-color: black;
color: white;
padding: 7px;
border-radius: 3px;
}
.rlynothing {
margin-left: 4%;
float: left;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}
.rlynothingagain {
height: 40%;
width: 1px;
background-color: grey;
}
/* SEARCH */
.swrap{
height: 100%;
float:left;
margin: auto;
display: flex;
align-items: center;
margin-left: 30px;
}
.search-container {
float:left;
display: flex;
width: 30px;
padding: 8px;
transition: width .2s;
overflow: hidden;
}
.search-container:hover{
width: 200px;
border: 2px solid black;
border-radius: 2px;
}
.search-input {
flex: 1;
display: flex;
}
.search-input input {
flex: 1;
background-clip: padding-box;
border: 0;
padding: 0;
outline: 0;
margin-left: 4px;
}
.navlinkborder {
background-color: limegreen;
padding: 10px;
border-radius: 3px;
}
.navlinkborder:hover {
background-color: green;
color: white;
transition: .5s;
}
<!DOCTYPE html>
<html lang="sk">
<head>
<!-- Site info -->
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<!-- CSS -->
<link rel="stylesheet" href="styles/normalize.css">
<link rel="stylesheet" href="styles/bootstrap-grid.css">
<link rel="stylesheet" href="styles/style.css">
<!-- Fonts -->
<link href="https://fonts.googleapis.com/css?family=Roboto:400,500,700" rel="stylesheet">
<script defer src="https://use.fontawesome.com/releases/v5.0.4/js/all.js"></script>
</head>
<body>
<!-- BEGIN - Header -->
<div class="navmenu">
<a href="index.php">
<div class="logo">
<p>Coding</p> <p class="logodif">Hub</p>
</div>
</a>
<div class="rlynothing">
<div class="rlynothingagain">
</div>
</div>
<div class="swrap">
<div class="search-container">
<div class="search-icon-btn">
<i class="fa fa-search fa-lg"></i>
</div>
<div class="search-input">
<input type="search" class="search-bar" placeholder="Hľadať...">
</div>
</div>
</div>
<div class="resmenu" id="flip">
<i class="fas fa-bars fa-2x"></i>
</div>
<div class="navlinksr">
Archív
Live
PODPORIŤ
Kontakt
<a class="navlinksline"></a>
Prihlásiť sa
</div>
</div>
<div id="panel" class="resmenuitems">
Archív
PODPORIŤ
Live
Kontakt
Prihlásiť sa
</div>
<!-- END - HEADER -->
Try below
set the header as fixed
.logo {
margin-left: 30px;
}
.rlynothing {
margin-left: 40px;
}
set search container full width
.search-container {
float:left;
display: flex;
width: 30px;
padding: 8px;
overflow: hidden;
position: absolute;
z-index: 1;
border: 2px solid white;
border-radius: 2px;
transition: all .2s;
}
.search-container:hover{
background: white;
width: calc(100% - 264px); /* 264px is the width of Header Image */
border-color: black;
}
You can calculate the width search bar using calc().
And to show the search bar above other elements, use position: absolute(relative) and z-index.
For z-index to work, you need to use position : absolute or position : relative
/* Navigation menu */
.resmenu {
display: none;
cursor: pointer;
}
.resmenuitems {
display: none;
}
.navmenu {
width: 100%;
height: 55px;
border-bottom: 1px solid rgb(240,240,240);
}
.logo {
color: black;
display: flex;
justify-content: center;
align-items: center;
width: 100px;
height: 100%;
font-size: 1.5em;
font-weight: bold;
float: left;
margin-left: 30px;
padding: 10px 0px 10px 0px;
}
.navlinksr {
float: right;
margin-right: 2%;
width: 490px;
height: 100%;
display: flex;
align-items: center;
justify-content:space-around;
}
.navlinksr a {
float: right;
text-decoration: none;
color: black;
font-size: 0.95em;
font-family: 'Roboto', sans-serif;
font-weight: bold;
}
.navlinksline {
height: 40%;
width: 1px;
background-color: grey;
}
.logodif {
background-color: black;
color: white;
padding: 7px;
border-radius: 3px;
}
.rlynothing {
margin-left: 40px;
float: left;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}
.rlynothingagain {
height: 40%;
width: 1px;
background-color: grey;
}
/* SEARCH */
.swrap{
height: 100%;
float:left;
margin: auto;
display: flex;
align-items: center;
margin-left: 30px;
}
.search-container {
float:left;
display: flex;
width: 30px;
padding: 8px;
overflow: hidden;
position: absolute;
z-index: 1;
border: 2px solid white;
border-radius: 2px;
transition: all .2s;
}
.search-container:hover{
background: white;
width: calc(100% - 264px); /* 264px is the width of Header Image */
border-color: black;
}
.search-input {
flex: 1;
display: flex;
}
.search-input input {
flex: 1;
background-clip: padding-box;
border: 0;
padding: 0;
outline: 0;
margin-left: 4px;
}
.navlinkborder {
background-color: limegreen;
padding: 10px;
border-radius: 3px;
}
.navlinkborder:hover {
background-color: green;
color: white;
transition: .5s;
}
<!DOCTYPE html>
<html lang="sk">
<head>
<!-- Site info -->
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<!-- CSS -->
<link rel="stylesheet" href="styles/normalize.css">
<link rel="stylesheet" href="styles/bootstrap-grid.css">
<link rel="stylesheet" href="styles/style.css">
<!-- Fonts -->
<link href="https://fonts.googleapis.com/css?family=Roboto:400,500,700" rel="stylesheet">
<script defer src="https://use.fontawesome.com/releases/v5.0.4/js/all.js"></script>
</head>
<body>
<!-- BEGIN - Header -->
<div class="navmenu">
<a href="index.php">
<div class="logo">
<p>Coding</p> <p class="logodif">Hub</p>
</div>
</a>
<div class="rlynothing">
<div class="rlynothingagain">
</div>
</div>
<div class="swrap">
<div class="search-container">
<div class="search-icon-btn">
<i class="fa fa-search fa-lg"></i>
</div>
<div class="search-input">
<input type="search" class="search-bar" placeholder="Hľadať...">
</div>
</div>
</div>
<div class="resmenu" id="flip">
<i class="fas fa-bars fa-2x"></i>
</div>
<div class="navlinksr">
Archív
Live
PODPORIŤ
Kontakt
<a class="navlinksline"></a>
Prihlásiť sa
</div>
</div>
<div id="panel" class="resmenuitems">
Archív
PODPORIŤ
Live
Kontakt
Prihlásiť sa
</div>
<!-- END - HEADER -->