Menu navigation bar | position issue - html

I have 2 problems with my navbar design.
First, the navbar stays at the top, even if I scroll down. I think it's due to the absolute position I gave to the <nav>.
Last but not least, when I roll out the menu (the height of my windows is short, like with a smartphone in landscape mode) and then I scroll down, there is no more background-color. I know this is due to "height: 100%;" (line 137 of CSS doc). But when I remove "height: 100%;", I haven't the transition that I had with "height: 100%;" declaration. How to resolve this issue?
Thanks a lot!
jQuery(document).ready(function(){
jQuery('#nav-burger').click(function() {
jQuery('.list-shown, .list-hidden').each(function() {
jQuery(this).toggleClass('list-shown').toggleClass('list-hidden');
});
});
});
#import url(https://fonts.googleapis.com/css?family=Raleway:400,300,200,100,500,600,700,800,900);
#import url(http://fonts.googleapis.com/css?family=Titillium+Web);
#viewport { /* peu supporté / ne remplace pas encore la balise <meta> */
width: device-width; /* largeur du viewport */
zoom: 1; /* zoom initial à 1.0 */
}
*, *::before, *::after {
box-sizing: border-box;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
}
html, body {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
overflow-x: hidden;
text-rendering: optimizelegibility;
}
img {
width: 100%;
}
nav {
margin:0;
background: rgba(0,0,0,0.7);
font-family:"Titillium Web", "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", "DejaVu Sans", Verdana, sans-serif;
font-weight: 600;
}
#navigationgenerale {
display: block;
position: absolute;
top: 0;
right: 0;
left: 0;
z-index: 10;
}
#navigationgenerale li {
list-style: none;
}
#navigationgenerale .nav-content {
margin:0 auto;
max-width: 1000px;
}
#navigationgenerale .nav-content ul {
margin: 0;
padding: .5em 0px;
line-height: 30px;
width: auto;
text-align: justify;
display: flex;
}
#navigationgenerale .nav-content .nav-header {
display: none;
}
#navigationgenerale .nav-content .nav-item {
display: inline-block;
position: relative;
height: 30px;
vertical-align: middle;
}
#navigationgenerale .nav-content .nav-item a {
text-decoration: none;
font-size: 22px;
}
#navigationgenerale.list-hidden .nav-content .nav-item a {
color: #ececec;
}
#navigationgenerale.list-shown .nav-content .nav-item a {
color: #191919;
}
#navigationgenerale .nav-content .nav-header {
justify-content: space-between;
}
#navigationgenerale .nav-content .nav-list {
justify-content: space-around;
}
#navigationgenerale.list-shown .nav-content ul.nav-list {
display: block;
padding: 5% 10%;
}
#navigationgenerale.list-shown .nav-content .nav-list li {
display: list-item;
border-bottom: #555 1px dotted;
padding: 15px 5px;
height: auto; /* important */
}
#navigationgenerale .nav-content .icon a {
display: inline-block;
overflow: hidden;
text-indent: 160%;
white-space: nowrap;
}
#navigationgenerale.list-hidden .nav-content .icon.nav-accueil a {
background: url("//alexandredomain.ovh/beta/sprite.svg#logo-ececec") 50% 50% no-repeat;
background-size: 50px;
transition: background 0.5s 0s ease-in;
}
#navigationgenerale.list-shown .nav-content .icon.nav-accueil a {
background: url("//alexandredomain.ovh/beta/sprite.svg#logo-191919") 50% 50% no-repeat;
background-size: 50px;
}
#navigationgenerale .nav-content .icon.nav-contact a {
background: url("//alexandredomain.ovh/beta/sprite.svg#letter-ececec") 50% 50% no-repeat;
background-size: 35px;
width: 50px;
height: auto;
}
#media screen and (max-width: 1760px) {
#navigationgenerale .nav-content ul.nav-header {
display: flex;
}
#navigationgenerale .nav-content .nav-list li.nav-accueil {
display: none;
}
#navigationgenerale.list-hidden .nav-content .nav-list {
display: none;
}
#navigationgenerale.list-shown {
background-color: #ececec;
transition: height 1s 1s ease-in-out, background-color .5s .5s linear;
color: #191919;
overflow-y: visible;
height: 100%;
}
#navigationgenerale.list-hidden {
height: 66px;
transition: height 1s 0s ease-in-out, background-color .5s 0s linear;
}
#navigationgenerale.list-shown .nav-content .nav-header .nav-contact a {
transform: translateY(-200%) translateX(200%) ;
transition: transform 0.5s .5s ease-in-out;
}
#navigationgenerale.list-shown .nav-content .nav-list ul {
display: block !important;
}
#navigationgenerale .nav-content ul {
margin: 10px 15px;
}
}
.list-shown line.ligne-haut {
stroke: #191919;
transform: translateY(28px) rotate(-405deg);
transform-origin: 50%;
transition: all 0.5s 0.2s cubic-bezier(0.4, 0.01, 0.165, 0.99);
}
.list-hidden line.ligne-haut {
transform: translateY(0px) rotate(0deg);
transform-origin: 50%;
transition: all 0.5s 0.2s cubic-bezier(0.4, 0.01, 0.165, 0.99);
}
.list-shown line.ligne-milieu {
opacity: 0;
transition: opacity 0.3s linear;
}
.list-hidden line.ligne-milieu {
opacity: 1;
transition: opacity 0.3s 0.5s linear;
}
.list-shown line.ligne-bas {
stroke: #191919;
transform: translateY(-28px) rotate(405deg);
transform-origin: 50%;
transition: all 0.5s 0.2s cubic-bezier(0.4, 0.01, 0.165, 0.99);
}
.list-hidden line.ligne-bas {
transform: translateY(0px) rotate(0deg);
transform-origin: 50%;
transition: all 0.5s 0.2s cubic-bezier(0.4, 0.01, 0.165, 0.99);
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<body>
<nav id="navigationgenerale" class="list-hidden" lang="fr-FR" aria-label="Navigation générale" role="navigation">
<div class="nav-content">
<ul class="nav-header">
<li class="nav-item nav-menu">
<svg id="nav-burger" x="0px" y="0px" height="35px" width="35px" viewBox="0 0 96 96">
<line class="ligne-haut" x1="12" y1="20" x2="84" y2="20" stroke="#ececec" stroke-width="8" stroke-linecap="round"></line>
<line class="ligne-milieu" x1="12" y1="48" x2="84" y2="48" stroke="#ececec" stroke-width="8" stroke-linecap="round" stroke-opacity="1"></line>
<line class="ligne-bas" x1="12" y1="76" x2="84" y2="76" stroke="#ececec" stroke-width="8" stroke-linecap="round"></line>
</svg>
</li>
<li class="nav-item nav-accueil icon">Accueil</li>
<li class="nav-item nav-contact icon">Contact</li>
</ul>
<ul class="nav-list">
<li class="nav-item nav-accueil icon">Accueil</li>
<li class="nav-item nav-parcours">Parcours</li>
<li class="nav-item nav-experience">Expérience</li>
<li class="nav-item nav-projet">Projet</li>
<li class="nav-item nav-loisirs">Loisirs</li>
<li class="nav-item nav-contact">Contact</li>
</ul>
</div>
</nav>
<div style="margin-top: 450px; font-family: Raleway; font-weight: 500; font-size: 60px;"> Test </div>
</body>

To your 1. question:
Change the postion:absolute to postion:relative #navigationgenerale block.
question:
Instead of height 100% change it to an specific value like 460px.

Related

I need my navbar to stop overlapping over the content

The content begins to appear on the page overlapped with the navbar, I cannot really figure out where can I solve this.
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<link rel="stylesheet" href="stil.css">
<script src="s.js"></script>
<title>Document</title>
</head>
<header>
<nav id="navbar" class="">
<div class="nav-wrapper">
<div class="logo">
<i class="fa fa-angellist"></i> Logo
</div>
<ul id="menu">
<li>Home</li>
<li>Matematica</li>
<li>Limba romana</li>
<li>Informatica</li>
<li>Contact</li>
</ul>
</div>
</nav>
<div class="menuIcon">
<span class="icon icon-bars"></span>
<span class="icon icon-bars overlay"></span>
</div>
<div class="overlay-menu">
<ul id="menu">
<li>Home</li>
<li>Services</li>
<li>About</li>
<li>Contact</li>
</ul>
</div>
</header>
<body>
<div class="container">
<div class="box">A</div>
<div class="box">B</div>
<div class="box">C</div>
<div class="box">D</div>
</div>
</body>
</html>
CSS
* {
border: 0;
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
background: rgb(250, 250, 250) url(http://lorempixel.com/1920/1080/nature/);
font-family: Lato, Helvetica, Arial, sans-serif;
}
header{
z-index: 1;
}
a {
color: inherit;
font-family: inherit;
font-size: inherit;
text-decoration: none;
}
/*======================================================
Navbar
======================================================*/
#navbar {
background: white;
color: rgb(13, 26, 38);
position: fixed;
top: 0;
height: 60px;
line-height: 60px;
width: 100vw;
z-index: 10;
}
.nav-wrapper {
margin: auto;
text-align: center;
width: 70%;
} #media(max-width: 768px) {
.nav-wrapper {
width: 90%;
}
} #media(max-width: 638px) {
.nav-wrapper {
width: 100%;
}
}
.logo {
float: left;
margin-left: 28px;
font-size: 1.5em;
height: 60px;
letter-spacing: 1px;
text-transform: uppercase;
} #media(max-width: 768px) {
.logo {
/* margin-left: 5px; */
}
}
#navbar ul {
display: inline-block;
float: right;
list-style: none;
/* margin-right: 14px; */
margin-top: -2px;
text-align: right;
transition: transform 0.5s ease-out;
-webkit-transition: transform 0.5s ease-out;
} #media(max-width: 640px) {
#navbar ul {
display: none;
}
} #media(orientation: landscape) {
#navbar ul {
display: inline-block;
}
}
#navbar li {
display: inline-block;
}
#navbar li a {
color: rgb(13, 26, 38);
display: block;
font-size: 0.7em;
height: 50px;
letter-spacing: 1px;
margin: 0 20px;
padding: 0 4px;
position: relative;
text-decoration: none;
text-transform: uppercase;
transition: all 0.5s ease;
-webkit-transition: all 0.5s ease;
}
#navbar li a:hover {
border-bottom: 1px solid rgb(28, 121, 184);
color: rgb(28, 121, 184);
transition: all 1s ease;
-webkit-transition: all 1s ease;
}
/* Animated Bottom Line */
#navbar li a:before, #navbar li a:after {
content: '';
position: absolute;
width: 0%;
height: 1px;
bottom: -1px;
background: rgb(13, 26, 38);
}
#navbar li a:before {
left: 0;
transition: 0.5s;
}
#navbar li a:after {
background: rgb(13, 26, 38);
right: 0;
/* transition: width 0.8s cubic-bezier(0.22, 0.61, 0.36, 1); */
}
#navbar li a:hover:before {
background: rgb(13, 26, 38);
width: 100%;
transition: width 0.5s cubic-bezier((0.22, 0.61, 0.36, 1));
}
#navbar li a:hover:after {
background: transparent;
width: 100%;
/* transition: 0s; */
}
/*======================================================
Mobile Menu Menu Icon
======================================================*/
#media(max-width: 640px) {
.menuIcon {
cursor: pointer;
display: block;
position: fixed;
right: 15px;
top: 20px;
height: 23px;
width: 27px;
z-index: 12;
}
/* Icon Bars */
.icon-bars {
background: rgb(13, 26, 38);
position: absolute;
left: 1px;
top: 45%;
height: 2px;
width: 20px;
-webkit-transition: 0.4s;
transition: 0.4s;
}
.icon-bars::before {
background: rgb(13, 26, 38);
content: '';
position: absolute;
left: 0;
top: -8px;
height: 2px;
width: 20px;
/* -webkit-transition: top 0.2s ease 0.3s;
transition: top 0.2s ease 0.3s; */
-webkit-transition: 0.3s width 0.4s;
transition: 0.3s width 0.4s;
}
.icon-bars::after {
margin-top: 0px;
background: rgb(13, 26, 38);
content: '';
position: absolute;
left: 0;
bottom: -8px;
height: 2px;
width: 20px;
/* -webkit-transition: top 0.2s ease 0.3s;
transition: top 0.2s ease 0.3s; */
-webkit-transition: 0.3s width 0.4s;
transition: 0.3s width 0.4s;
}
/* Bars Shadows */
.icon-bars.overlay {
background: rgb(97, 114, 129);
background: rgb(183, 199, 211);
width: 20px;
animation: middleBar 3s infinite 0.5s;
-webkit-animation: middleBar 3s infinite 0.5s;
} #keyframes middleBar {
0% {width: 0px}
50% {width: 20px}
100% {width: 0px}
} #-webkit-keyframes middleBar {
0% {width: 0px}
50% {width: 20px}
100% {width: 0px}
}
.icon-bars.overlay::before {
background: rgb(97, 114, 129);
background: rgb(183, 199, 211);
width: 10px;
animation: topBar 3s infinite 0.2s;
-webkit-animation: topBar 3s infinite 0s;
} #keyframes topBar {
0% {width: 0px}
50% {width: 10px}
100% {width: 0px}
} #-webkit-keyframes topBar {
0% {width: 0px}
50% {width: 10px}
100% {width: 0px}
}
.icon-bars.overlay::after {
background: rgb(97, 114, 129);
background: rgb(183, 199, 211);
width: 15px;
animation: bottomBar 3s infinite 1s;
-webkit-animation: bottomBar 3s infinite 1s;
} #keyframes bottomBar {
0% {width: 0px}
50% {width: 15px}
100% {width: 0px}
} #-webkit-keyframes bottomBar {
0% {width: 0px}
50% {width: 15px}
100% {width: 0px}
}
/* Toggle Menu Icon */
.menuIcon.toggle .icon-bars {
top: 5px;
transform: translate3d(0, 5px, 0) rotate(135deg);
transition-delay: 0.1s;
transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
.menuIcon.toggle .icon-bars::before {
top: 0;
transition-delay: 0.1s;
opacity: 0;
}
.menuIcon.toggle .icon-bars::after {
top: 10px;
transform: translate3d(0, -10px, 0) rotate(-270deg);
transition-delay: 0.1s;
transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
.menuIcon.toggle .icon-bars.overlay {
width: 20px;
opacity: 0;
-webkit-transition: all 0s ease 0s;
transition: all 0s ease 0s;
}
}
/*======================================================
Responsive Mobile Menu
======================================================*/
.overlay-menu {
background: lightblue;
color: rgb(13, 26, 38);
display: flex;
align-items: center;
justify-content: center;
position: absolute;
top: 0;
right: 0;
padding-right: 15px;
transform: translateX(-100%);
width: 100vw;
height: 100vh;
-webkit-transition: transform 0.2s ease-out;
transition: transform 0.2s ease-out;
}
.overlay-menu ul, .overlay-menu li {
display: block;
position: relative;
}
.overlay-menu li a {
display: block;
font-size: 1.8em;
letter-spacing: 4px;
/* opacity: 0; */
padding: 10px 0;
text-align: right;
text-transform: uppercase;
-webkit-transition: color 0.3s ease;
transition: color 0.3s ease;
/* -webkit-transition: 0.2s opacity 0.2s ease-out;
transition: 0.2s opacity 0.2s ease-out; */
}
.overlay-menu li a:hover,
.overlay-menu li a:active {
color: rgb(28, 121, 184);
-webkit-transition: color 0.3s ease;
transition: color 0.3s ease;
}
.timetable {
display: grid;
grid-template-areas: ". week" "time content";
grid-template-columns: 120px;
grid-template-rows: 60px;
width: 100vw;
height: 100vh;
}
.timetable .week-names {
grid-area: week;
display: grid;
grid-template-columns: repeat(5, 1fr);
text-transform: uppercase;
font-size: 12px;
}
.timetable .week-names > div {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height:100%;
box-shadow: inset 3px 0 0 black;
margin-top: 50px;
font: inherit;
font-size: large;
}
.timetable .time-interval {
grid-area: time;
display: grid;
grid-template-rows: repeat(7, 1fr);
font-size: 14px;
}
.timetable .time-interval > div {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
box-shadow: inset 0 3px 0 0 black;
}
.timetable .content {
grid-area: content;
display: grid;
grid-template-rows: repeat(7, 1fr);
grid-template-columns: repeat(5, 1fr);
}
.timetable .content > div {
box-shadow: inset 3px 0 0 black, inset 0 3px 0 0 black;
font: inherit;
font-size: large;
display: flex;
align-items: center;
justify-content: center;
}
.container {
margin: 20px auto;
width: 400px;
height: 400px;
background-color: #fff;
display: grid;
grid-template-columns: 200px 200px;
grid-row: auto auto;
grid-column-gap: 20px;
grid-row-gap: 20px;
}
.container .box {
background-color: #333;
padding: 20px;
border-radius: 10px;
color: #fff;
display: flex;
align-items: center;
justify-content: center;
font-size: 40px;
font-family: sans-serif;
}
The fixed attribute doesn't affect the layout of the rest of the page,
Since you have a fixed height for your fixed element, you can add
margin-top: 60px;
to your primary container element to add in the space that the fixed element would normally have taken.

Menu button wont move vertically

I’m trying to make a menu open button for my website, but there’s one slight problem, when I try to assign it to move vertically, for example do margin-top: 100px it won’t move. But when I set a margin-left it changes position and moves horizontally! I have no idea as to why this is happening. I would love to get some advice on how to put the menu button a bit further downwards. I have a feeling it has something to do with the attribute being a span, but I have no idea. Any help is greatly appreciated.
function openNav() {
document.getElementById("myNav").style.width = "100%";
}
function closeNav() {
document.getElementById("myNav").style.width = "0%";
}
#import url("https://fonts.googleapis.com/css2?family=Montserrat:wght#400;500;600;700&display=swap");
* {
margin: 0;
padding: 0;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
body {
font-family: "Montserrat", sans-serif;
background-size: cover;
}
#myVideo {
position: fixed;
right: 0;
bottom: 0;
min-width: 100%;
min-height: 100%;
}
.navMenu {
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
}
.overlay a {
padding: 8px;
text-decoration: none;
font-size: 36px;
color: #818181;
display: block;
transition: 0.3s;
}
.navMenu a {
color: #f6f4e6;
text-decoration: none;
font-size: 1.2em;
text-transform: uppercase;
font-weight: 500;
font-size: 40px;
display: inline-block;
width: 160px;
-webkit-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
padding: 0px;
padding-bottom: 5px;
}
.navMenu a:hover {
color: #fddb3a;
}
.navMenu .dot {
width: 6px;
height: 6px;
background: #fddb3a;
border-radius: 50%;
opacity: 0;
-webkit-transform: translateX(30px);
transform: translateX(30px);
-webkit-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
}
.navMenu a:nth-child(1):hover~.dot {
-webkit-transform: translateX(80px);
transform: translateX(80px);
-webkit-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
opacity: 1;
}
.navMenu a:nth-child(2):hover~.dot {
-webkit-transform: translateX(240px);
transform: translateX(240px);
-webkit-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
opacity: 1;
}
.navMenu a:nth-child(3):hover~.dot {
-webkit-transform: translateX(400px);
transform: translateX(400px);
-webkit-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
opacity: 1;
}
.navMenu a:nth-child(4):hover~.dot {
-webkit-transform: translateX(570px);
transform: translateX(570px);
-webkit-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
opacity: 1;
}
.overlay {
height: 100%;
width: 0;
position: fixed;
z-index: 1;
top: 0;
left: 0;
background-color: rgb(0,0,0);
background-color: rgba(0,0,0, 0.9);
overflow-x: hidden;
transition: 0.5s;
}
.overlay-content {
position: relative;
top: 50%;
width: 100%;
text-align: center;
}
.overlay .closebtn {
position: absolute;
top: 20px;
margin-right: 20px;
right: 45px;
font-size: 120px;
}
.openNav {
font-size: 50px;
margin-left: 100px;
color: black;
}
#media screen and (max-width: 1305px) {
.dot {
display: none;
}
}
#media screen and (max-height: 450px) {
.overlay a {
font-size: 20px
}
.overlay .closebtn {
font-size: 40px;
top: 15px;
right: 35px;
}
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>City</title>
<link href="index.css" rel="stylesheet" type="text/css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="index.js"></script>
</head>
<body>
<div id="myNav" class="overlay">
×
<div class="overlay-content">
<nav class="navMenu">
Home
Blog
Work
About
<div class="dot"></div>
</nav>
</div>
</div>
<span class="openNav" style="cursor: pointer;" onclick="openNav()">☰</span>
</body>
</html>
I have a feeling it has something to do with the attribute being a span
That is right, because the span is by default has display: inline, and if you change it to display: block and apply some margin-top: 100px you see it changes the position.
.openNav{
display: block;
margin-top: 100px;
}

How to make CSS style work in Safari browser?

I’m building my first website, trying to adapt it to the most popular browsers, and the css style works correctly in all browsers except Safari. In this browser, almost everything does not work for me: the hover effect is not linear, flexbox is not displayed correctly (1,2,3 screen - as displayed in safari; 4,5,6 screen - as should be in all browsers), in the mobile version the menu by the span button does not open. I threw the code in https://autoprefixer.github.io/ru/, because I understand that there are not enough prefixes, but it did not help me, after saving the code and updating the page, everything remained in its place. Tell me, please, what to do then?
html {
overflow: scroll;
overflow-x: hidden;
height: 100%;
}
::-webkit-scrollbar {
width: 0px;
}
body {
margin: 0;
width: 100%;
display: -webkit-box;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
flex-direction: column;
min-height: 100%;
}
a {
text-decoration: none;
color: black;
}
.wrapper {
display: block;
max-width: 2560px;
flex-grow: 1;
margin-top: 10px;
margin-left: 20%;
margin-right: 20%;
position: relative;
z-index: 7;
text-align: center;
}
.content span {
font-family: 'PT Serif', serif;
font-family: 'PT Sans', sans-serif;
font-size: 26px;
}
header, nav, section, footer {
font-family: 'Merriweather', serif;
color: rgb(0, 0, 0);
}
.header {
background-image: url(../img/12321.jpg);
background-position: top right;
background-size: cover;
max-height: 250px;
width: 100%;
}
.nav li a {
display: block;
text-align: center;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
-o-user-select: none;
user-select: none;
}
.logo-header {
height: 40px;
position: relative;
float: right;
margin: 200px 10px 0 0;
}
.nav {
height: 100vh;
margin-left: calc(20% - 100px);
position: relative;
outline: none;
}
.nav ul {
list-style: none;
padding: 0.5em 0;
margin: 0;
}
.nav ul li {
margin: 10px;
height: 40px;
line-height: 40px;
background-color: white;
padding: 0.5em 1em 0.5em 1em;
font-size: 24px;
background-repeat: no-repeat;
background-position: left 15px center;
background-size: auto 40px;
transition: all 0.15s linear;
border-radius: 5px;
border: 1px solid black;
opacity: 0.75;
}
.menu {
display: grid;
grid-template-areas:
"home home"
"gallery ut"
"journal contact";
grid-template-rows: 65px 65px 65px;
grid-template-columns: 350px 350px;
grid-gap: 10px;
height: 100vh;
position: relative;
z-index: 5;
}
.home {
grid-area: home;
}
.gallery {
grid-area: gallery;
}
.ut {
grid-area: ut;
}
.journal {
grid-area: journal;
}
.contact {
grid-area: contact;
}
.nav img {
float: left;
}
.menu li:hover {
background-color: #ffffff;
opacity: 1;
}
#media screen and (max-width: 1024px) {
body {
min-height: 99vh;
}
.wrapper {
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
flex-direction: column;
}
/* MENU STYLE */
.menu {
display: none;
background-image: url(../img/Фон.png);
height: 100%;
position: relative;
z-index: 5;
}
.nav {
margin-left: 0;
}
div.burger {
height: 30px;
width: 40px;
position: absolute;
top: 11px;
left: 21px;
z-index: 30;
}
div.x,
div.y,
div.z {
position: absolute; margin: auto;
top: 0px; bottom: 0px;
background: #fff;
border-radius:2px;
-webkit-transition: all 200ms ease-out;
-moz-transition: all 200ms ease-out;
-ms-transition: all 200ms ease-out;
-o-transition: all 200ms ease-out;
transition: all 200ms ease-out;
}
div.x, div.y, div.z { height: 3px; width: 26px; }
div.y {top: 18px;}
div.z {top: 37px;}
div.collapse {
top: 20px;
-webkit-transition: all 70ms ease-out;
-moz-transition: all 70ms ease-out;
-ms-transition: all 70ms ease-out;
-o-transition: all 70ms ease-out;
transition: all 70ms ease-out;
}
div.rotate30 {
-ms-transform: rotate(30deg);
-webkit-transform: rotate(30deg);
transform: rotate(30deg);
-webkit-transition: all 50ms ease-out;
-moz-transition: all 50ms ease-out;
-ms-transition: all 50ms ease-out;
-o-transition: all 50ms ease-out;
transition: all 50ms ease-out;
}
div.rotate150 {
-ms-transform: rotate(150deg);
-webkit-transform: rotate(150deg);
transform: rotate(150deg);
-webkit-transition: all 50ms ease-out;
-moz-transition: all 50ms ease-out;
-ms-transition: all 50ms ease-out;
-o-transition: all 50ms ease-out;
transition: all 50ms ease-out;
}
div.rotate45 {
-ms-transform: rotate(45deg);
-webkit-transform: rotate(45deg);
transform: rotate(45deg);
-webkit-transition: all 100ms ease-out;
-moz-transition: all 100ms ease-out;
-ms-transition: all 100ms ease-out;
-o-transition: all 100ms ease-out;
transition: all 100ms ease-out;
}
div.rotate135 {
-ms-transform: rotate(135deg);
-webkit-transform: rotate(135deg);
transform: rotate(135deg);
-webkit-transition: all 100ms ease-out;
-moz-transition: all 100ms ease-out;
-ms-transition: all 100ms ease-out;
-o-transition: all 100ms ease-out;
transition: all 100ms ease-out;
}
div.menu-bg {
width: 100%;
height: 100%;
position:absolute;
top:0;
left:0;
-webkit-transition: all 300ms cubic-bezier(0.000, 0.995, 0.990, 1.000);
-moz-transition: all 300ms cubic-bezier(0.000, 0.995, 0.990, 1.000);
-ms-transition: all 300ms cubic-bezier(0.000, 0.995, 0.990, 1.000);
-o-transition: all 300ms cubic-bezier(0.000, 0.995, 0.990, 1.000);
transition: all 300ms cubic-bezier(0.000, 0.995, 0.990, 1.000);
}
ul.menu {
padding-top: 5em;
}
ul.menu li {
width:300px;
margin: 0 auto;
}
ul.menu span {
text-align: right;
}
ul.menu li a {
background-color: white;
color:rgb(0, 0, 0);
opacity: 0.75;
}
section > div {
transition: transform 1s;
transform: translateX(0px);
}
}
footer {
position: relative;
flex-shrink: 0;
height: 10px;
width: 100%;
bottom: 0;
z-index: 6;
}
/* MAIN CONTENT */
.box-image {
width: 30%;
min-width: 120px;
height: 120px;
background-size: 120px 120px;
background-position: center;
position: relative;
float: left;
margin: 5vh 10px 10px 10px;
}
#media screen and (max-width: 1024px) and (min-width: 381px) {
.box-image {
width: 33,3333%;
}
}
#media screen and (max-width: 380px) {
.box-image {
width: 50%;
height: 100px;
background-size: 100px 100px;
}
}
.vkontakte {
background-image: url(../img/vk.svg);
background-repeat: no-repeat;
}
.instagram {
background-image: url(../img/instagram.svg);
background-repeat: no-repeat;
}
.whatsupp {
background-image: url(../img/whatsapp.svg);
background-repeat: no-repeat;
}
.mail {
background-image: url(../img/mailru.svg);
background-repeat: no-repeat;
}
.link-image {
position: absolute;
top: 0;
bottom: 0;
width: 100%;
}
.ContactWithMe {
display: inline-block;
position:relative;
text-align: center;
width: 100%;
}
.ContactWithMe a {
position: relative;
display: inline-block;
text-align:center;
width:120px;
height:120px;
}
/* FOOTER */
.social-block {
display: flex;
flex-direction: row;
flex-wrap: wrap;
align-content: center;
justify-content: center;
width: 100%;
}
.social-block a {
color: #000000;
width: 40px;
height: 40px;
font-size: 20px;
overflow: hidden;
padding: 10px;
}
a {
text-decoration: none;
transition: 0.3s linear;
}
.vk a:hover {
color: #45668e
}
.inst a:hover{
color: #e4405f;
}
.wa a:hover {
color: #25D366
}
</head>
<body>
<header class="header">
<div> <img class="logo-header" src="../img/logo-main.png" alt="#"> </div>
<nav class="nav" role="navigation">
<div class="menu-bg"></div>
<ul class="menu" id="see">
<li class="home"><img src="../img/home.svg" alt="#" height="40px"><span>Главная</span></li>
<li class="gallery"><img src="../img/art.svg" alt="#" height="40px"><span>Галерея</span></li>
<li class="ut"><img src="../img/sew.svg" alt="#" height="40px"><span>Полезные советы</span></li>
<li class="journal"><img src="../img/portrait.svg" alt="#" height="40px"><span>Журнал</span></li>
<li class="contact"><img src="../img/contact.svg" alt="#" height="40px"><span>Контакты</span></li>
</ul>
<div class="burger">
<div class="x"></div>
<div class="y"></div>
<div class="z"></div>
</div>
</nav>
</header>
<div class="wrapper">
<div class=ContactWithMe>
<div class="box-image vkontakte">
</div>
<div class="box-image instagram">
</div>
<div class="box-image whatsupp">
</div>
<div class="box-image mail">
</div>
</div>
</div>
<footer>
<div class="social-block">
<div class="social vk">
<i class="fa fa-vk fa-2x"></i>
</div>
<div class="social inst">
<i class="fa fa-instagram fa-2x gradient-icon"></i>
</div>
<div class="social wa">
<i class="fa fa-whatsapp fa-2x" target="_blank"></i>
</div>
</div>
</footer>
</body>
Seems to me that some elements get display: block which is the default.
Did you try adding all prefixes for display: flex ?
display: -webkit-box; // OLD - iOS 6-, Safari 3.1-6
display: -moz-box; // OLD - Firefox 19- (buggy but mostly works)
display: -ms-flexbox; // TWEENER - IE 10
display: -webkit-flex; // NEW - Chrome
display: flex; // NEW, Spec - Opera 12.1, Firefox 20+
For Safari try adding -webkit- prefix to all flexbox properties.
Safari still requires the -webkit- prefix to use flexbox.
Just try -webkit-flexbox. it's working for safari., webkit-flex safari will not taking.
I advise you to see that:
How do I make flex box work in safari?
sorry for google translate

Upgrading to bootstrap 4, menu doesn't hide

I'm trying to upgrade my entire project from bootstrap 3.3.0 to bootstrap 4.0.0, but an important element isn't shown as it should, a side menu.
This is the basic code of the menu:
$(document).ready(function() {
var trigger = $('.hamburger'),
overlay = $('.overlay'),
isClosed = false;
trigger.click(function() {
hamburger_cross();
});
function hamburger_cross() {
if (isClosed == true) {
overlay.hide();
trigger.removeClass('is-open');
trigger.addClass('is-closed');
isClosed = false;
} else {
overlay.show();
trigger.removeClass('is-closed');
trigger.addClass('is-open');
isClosed = true;
}
}
$('[data-toggle="offcanvas"]').click(function() {
$('#wrapper').toggleClass('toggled');
});
});
body {
position: relative;
overflow-x: hidden;
}
body,
html {
height: 100%;
}
.nav .open>a,
.nav .open>a:hover,
.nav .open>a:focus {
background-color: transparent;
}
/*-------------------------------*/
/* Wrappers */
/*-------------------------------*/
#wrapper {
padding-left: 0;
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
}
#wrapper.toggled {
padding-left: 220px;
}
#sidebar-wrapper {
z-index: 1000;
left: 220px;
width: 0;
height: 100%;
margin-left: -220px;
overflow-y: auto;
overflow-x: hidden;
background: #1a1a1a;
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
}
#sidebar-wrapper::-webkit-scrollbar {
display: none;
}
#wrapper.toggled #sidebar-wrapper {
width: 220px;
}
#page-content-wrapper {
width: 100%;
padding-top: 70px;
}
#wrapper.toggled #page-content-wrapper {
position: absolute;
margin-right: -220px;
}
/*-------------------------------*/
/* Sidebar nav styles */
/*-------------------------------*/
.sidebar-nav {
position: absolute;
top: 0;
width: 220px;
margin: 0;
padding: 0;
list-style: none;
}
.sidebar-nav li {
position: relative;
line-height: 20px;
display: inline-block;
width: 100%;
}
.sidebar-nav li:before {
content: '';
position: absolute;
top: 0;
left: 0;
z-index: -1;
height: 100%;
width: 3px;
background-color: #1c1c1c;
-webkit-transition: width .2s ease-in;
-moz-transition: width .2s ease-in;
-ms-transition: width .2s ease-in;
transition: width .2s ease-in;
}
.sidebar-nav li:first-child a {
color: #fff;
background-color: #1a1a1a;
}
.sidebar-nav li:nth-child(2):before {
background-color: #ec1b5a;
}
.sidebar-nav li:nth-child(3):before {
background-color: #79aefe;
}
.sidebar-nav li:nth-child(4):before {
background-color: #314190;
}
.sidebar-nav li:nth-child(5):before {
background-color: #279636;
}
.sidebar-nav li:nth-child(6):before {
background-color: #7d5d81;
}
.sidebar-nav li:nth-child(7):before {
background-color: #ead24c;
}
.sidebar-nav li:nth-child(8):before {
background-color: #2d2366;
}
.sidebar-nav li:nth-child(9):before {
background-color: #35acdf;
}
.sidebar-nav li:hover:before,
.sidebar-nav li.open:hover:before {
width: 100%;
-webkit-transition: width .2s ease-in;
-moz-transition: width .2s ease-in;
-ms-transition: width .2s ease-in;
transition: width .2s ease-in;
}
.sidebar-nav li a {
display: block;
color: #ddd;
text-decoration: none;
padding: 10px 15px 10px 30px;
}
.sidebar-nav li a:hover,
.sidebar-nav li a:active,
.sidebar-nav li a:focus,
.sidebar-nav li.open a:hover,
.sidebar-nav li.open a:active,
.sidebar-nav li.open a:focus {
color: #fff;
text-decoration: none;
background-color: transparent;
}
.sidebar-nav>.sidebar-brand {
height: 65px;
font-size: 20px;
line-height: 44px;
}
.sidebar-nav .dropdown-menu {
position: relative;
width: 100%;
padding: 0;
margin: 0;
border-radius: 0;
border: none;
background-color: #222;
box-shadow: none;
}
/*-------------------------------*/
/* Hamburger-Cross */
/*-------------------------------*/
.hamburger {
position: fixed;
top: 20px;
z-index: 999;
display: block;
width: 32px;
height: 32px;
margin-left: 15px;
background: transparent;
border: none;
}
.hamburger:hover,
.hamburger:focus,
.hamburger:active {
outline: none;
}
.hamburger.is-closed:before {
content: '';
display: block;
width: 100px;
font-size: 14px;
color: #fff;
line-height: 32px;
text-align: center;
opacity: 0;
-webkit-transform: translate3d(0, 0, 0);
-webkit-transition: all .35s ease-in-out;
}
.hamburger.is-closed:hover:before {
opacity: 1;
display: block;
-webkit-transform: translate3d(-100px, 0, 0);
-webkit-transition: all .35s ease-in-out;
}
.hamburger.is-closed .hamb-top,
.hamburger.is-closed .hamb-middle,
.hamburger.is-closed .hamb-bottom,
.hamburger.is-open .hamb-top,
.hamburger.is-open .hamb-middle,
.hamburger.is-open .hamb-bottom {
position: absolute;
left: 0;
height: 4px;
width: 100%;
}
.hamburger.is-closed .hamb-top,
.hamburger.is-closed .hamb-middle,
.hamburger.is-closed .hamb-bottom {
background-color: #1a1a1a;
}
.hamburger.is-closed .hamb-top {
top: 5px;
-webkit-transition: all .35s ease-in-out;
}
.hamburger.is-closed .hamb-middle {
top: 50%;
margin-top: -2px;
}
.hamburger.is-closed .hamb-bottom {
bottom: 5px;
-webkit-transition: all .35s ease-in-out;
}
.hamburger.is-closed:hover .hamb-top {
top: 0;
-webkit-transition: all .35s ease-in-out;
}
.hamburger.is-closed:hover .hamb-bottom {
bottom: 0;
-webkit-transition: all .35s ease-in-out;
}
.hamburger.is-open .hamb-top,
.hamburger.is-open .hamb-middle,
.hamburger.is-open .hamb-bottom {
background-color: #1a1a1a;
}
.hamburger.is-open .hamb-top,
.hamburger.is-open .hamb-bottom {
top: 50%;
margin-top: -2px;
}
.hamburger.is-open .hamb-top {
-webkit-transform: rotate(45deg);
-webkit-transition: -webkit-transform .2s cubic-bezier(.73, 1, .28, .08);
}
.hamburger.is-open .hamb-middle {
display: none;
}
.hamburger.is-open .hamb-bottom {
-webkit-transform: rotate(-45deg);
-webkit-transition: -webkit-transform .2s cubic-bezier(.73, 1, .28, .08);
}
.hamburger.is-open:before {
content: '';
display: block;
width: 100px;
font-size: 14px;
color: #fff;
line-height: 32px;
text-align: center;
opacity: 0;
-webkit-transform: translate3d(0, 0, 0);
-webkit-transition: all .35s ease-in-out;
}
.hamburger.is-open:hover:before {
opacity: 1;
display: block;
-webkit-transform: translate3d(-100px, 0, 0);
-webkit-transition: all .35s ease-in-out;
}
/*-------------------------------*/
/* Overlay */
/*-------------------------------*/
.overlay {
position: fixed;
display: none;
width: 100%;
height: 100%;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(250, 250, 250, .8);
z-index: 1;
}
<head>
<meta charset="utf-8">
<meta name="robots" content="noindex, nofollow">
<title>loleo</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="http://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<!DOCTYPE html>
<html lang="en">
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<!--NO TOCAR-->
<script src="sidebar.js"></script>
<link rel="stylesheet" type="text/css" href="signup.css">
<link href="sidebar.css" rel="stylesheet" id="bootstrap-css">
</head>
<body>
<div id="wrapper">
<div class="overlay"></div>
<!-- SIDEBAR -->
<nav class="navbar navbar-dark bg-dark fixed-top navbar-expand-md" id="sidebar-wrapper" role="navigation">
<ul class="nav sidebar-nav">
<li class="sidebar-brand nav-item"> <a href="#" class="nav-link">
LOGO
</a>
</li>
<li class="nav-item"> READ
</li>
<li class="nav-item"> HISTORY
</li>
<li class="nav-item"> NOTIFICATIONS
</li>
<li class="dropdown nav-item"> CONFIG<span class="caret"></span>
<ul class="dropdown-menu" role="menu">
<li class="dropdown-item">PROFILE
</li>
<li class="dropdown-item">PREMIUM
</li>
<li class="dropdown-item">LOG OUT
</li>
</ul>
</li>
</ul>
</nav>
<!-- FIN DEL SIDEBAR -->
<!-- INICIO DEL BODY -->
<div id="page-content-wrapper">
<button type="button" class="hamburger is-closed" data-toggle="offcanvas"> <span class="hamb-top"></span>
<span class="hamb-middle"></span>
<span class="hamb-bottom"></span>
</button>
<!--modificable desde aquí-->
<!--hasta aquí-->
</div>
<!-- z -->
</div>
</body>
</html>
So, as you might have guessed, the menu should disappear totally when it's closed. I think a class is wrong, I have tried to change some of them, but don't know which one. Any idea?
I've finally found the problem.
in
<nav class="navbar navbar-dark bg-dark fixed-top navbar-expand-md" id="sidebar-wrapper" role="navigation">
It's useless writting the "navbar" class of the css, it is superimposing, so "there are two sidebars". Just deleted this class from the label and finished.

Nav bar not displaying correctly when testing responsiveness

So I have this page with a nav bar, and on the nav bar, there is a img logo on the left and 3 links on the right. And when I test responsiveness with devices on Chrome, the nav bar resizes and shifts to the left, leaving a blank space on it's right. Here's a picture Nav bar not displaying fully
And here is all my code:
#font-face {
font-family: coyote;
src: url(font/coyote.ttf);
}
html {
width: 100%;
height: 100%;
}
* {
margin: 0;
padding: 0;
}
body {
overflow: hidden;
margin: 0;
padding: 0;
}
nav {
background: #efefef;
overflow: hidden;
box-shadow: -2px -7px 47px 9px rgba(0, 0, 0, 0.35);
-moz-box-shadow: -2px -7px 47px 9px rgba(0, 0, 0, 0.35);
-webkit-box-shadow: -2px -7px 47px 9px rgba(0, 0, 0, 0.35);
z-index: 999;
margin: 0;
padding: 0;
}
.logo-section {
float: left;
padding: 25px;
font-family: serif;
}
.logo-left {
width: 12%;
float: left;
overflow: none;
display: block;
margin: auto;
transform: translateY(20%);
}
.hb-button {
float: right;
background-color: rgba(0, 0, 255, 0);
color: black;
border: none;
font-size: 18px;
padding: 9px 10px;
border-radius: 3px;
cursor: pointer;
display: none;
outline: none;
}
nav a {
text-decoration: none;
color: #282828;
font-size: 16px;
}
nav ul {
overflow: hidden;
color: #fff;
margin: 0;
height: 68px;
text-align: center;
transition: max-height 0.5s;
-webkit-transition: max-height 0.5s;
-moz-transition: max-height 0.5s;
-ms-transition: max-height 0.5s;
-o-transition: max-height 0.5s;
}
nav ul li {
float: right;
display: inline-block;
font-family: coyote;
}
li > a {
color: #000;
text-decoration: none;
transition-timing-function: ease-in-out;
}
li > a:hover {
color: #CF2034;
transition: color .7s cubic-bezier(0.11, 0.7, 0, 1);
-o-transition: color .7s cubic-bezier(0.11, 0.7, 0, 1);
-moz-transition: color .7s cubic-bezier(0.11, 0.7, 0, 1);
-webkit-transition: color .7s cubic-bezier(0.11, 0.7, 0, 1);
transition-timing-function: ease-in-out;
}
li > a:after {
position: absolute;
bottom: 0;
left: 0;
display: block;
width: 100%;
height: 2px;
background-color: #CF2034;
content: "";
transform: scale(0);
-o-transition: transform 1s cubic-bezier(0.11, 0.7, 0, 1);
-moz-transition: transform 1s cubic-bezier(0.11, 0.7, 0, 1);
-webkit-transition: transform 1s cubic-bezier(0.11, 0.7, 0, 1);
transition: transform 1s cubic-bezier(0.11, 0.7, 0, 1);
transition-timing-function: ease-in-out;
}
li > a:hover:after {
transform: scale(1);
}
.image-cont {
position: absolute;
min-width: 45%;
min-height: 45%;
top: 55%;
left: 50%;
overflow: visible;
}
.image {
animation: load_up 2s forwards;
-webkit-animation: load_up 2s forwards;
-moz-animation: load_up 2s forwards;
-o-animation: load_up 2s forwards;
margin-top: -50%;
margin-left: -50%;
position: relative;
}
.image-cont2 {
position: absolute;
top: 35%;
left: 50%;
overflow: visible;
}
.image2 {
display: none;
animation: load_up 2s forwards;
-webkit-animation: load_up 2s forwards;
-moz-animation: load_up 2s forwards;
-o-animation: load_up 2s forwards;
}
#media screen and (max-device-width: 1603px) and (min-device-width: 1081px) {
* {
margin: 0;
padding: 0;
}
header {
padding: 0;
margin: 0;
}
nav {
margin: 0;
padding: 0;
width: 100%;
}
nav ul {
margin: 0;
padding: 0;
z-index: 99999;
}
nav ul li {
margin 0;
}
}
#media screen and (max-device-width: 1080px) {
.logo-section {
float: none;
}
nav ul {
background: #ffffff;
max-height: 0px;
height: 0;
}
nav ul.show {
max-width: 100%;
max-height: 100%;
z-index: 9999;
height: 100%;
width: 100%;
}
nav ul li {
box-sizing: border-box;
width: 100%;
height: 100%;
padding: 15px;
padding-left: 25%;
text-align: center;
}
nav a {
display: block;
}
.hb-button {
display: inline;
}
.image {
display: none;
}
.image2 {
display: block;
margin-top: -35%;
margin-left: -50%;
}
.logo-left {
transform: translateY(-65%);
padding-left: 15px;
width: 10%;
}
}
#keyframes load_up {
0% {
opacity: 0;
transform: translateY(11%);
}
100% {
opacity: 1;
transform: translateY(0px);
}
}
#-webkit-keyframes load_up {
0% {
opacity: 0;
transform: translateY(11%);
}
100% {
opacity: 1;
transform: translateY(0px);
}
}
#-moz-keyframes load_up {
0% {
opacity: 0;
transform: translateY(11%);
}
100% {
opacity: 1;
transform: translateY(0px);
}
}
#-o-keyframes load_up {
0% {
opacity: 0;
transform: translateY(11%);
}
100% {
opacity: 1;
transform: translateY(0px);
}
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
<script type="text/javascript" src="js/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="js/responsive_navbar.js"></script>
<link rel="stylesheet" href="main.css">
<header>
<nav>
<div class="logo-section">
<button class="hb-button"><i class="fa fa-bars" aria-hidden="true"></i>
</button>
</div>
<div style="min-width: 1920px; margin: 0 auto;">
<a href="index.html"><img src="img/thermocase.png" class="logo-left">
</a>
</div>
<ul>
<li> ● Contact Us
</li>
<li> ● The Team
</li>
<li> ● Our Product
</li>
</ul>
</nav>
</header>
<div class="image-cont">
<img src="img/iphone.png" class="image" />
</div>
<div class="image-cont2">
<img src="img/iphone2.png" class="image2" />
</div>
Thanks for taking a look. Fyi, I'm new to this.
Two things you could start with.
You need to have your opening <body> tag immediately after your closing </head> tag, so you might want to consider using another div to wrap the main content on your page
<html>
<head> ... </head>
<body>
<header> ... </header>
<div class="main-content"> ... </div>
</body>
</html>
Secondly, at line 19 of your HTML you have
<div style="min-width: 1920px; margin: 0 auto;">
Hard coding the width of an element like this is going to give you a hard time once the viewport is less that 1920px. You might want to remove this inline CSS, and replace it with a class. Then you can easily manipulate the width of the div using CSS media queries, e.g.
HTML
<div class="logo-wrap"> ... </div>
CSS
.logo-wrap{
...
}
#media (min-width: 1920px) {
min-width: 1920px;
margin: 0 auto;
}
Edit
Try changing your viewport meta tag to
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
Good luck!