I'm trying to make a header section 100% of the viewport with height: 100vh;
.
But somehow it's overflowing.
When looking in the devtools I see that the cause of this problem comes from my navbar. Here's the structure of the HTML:
---body
------header
---------nav
-----------other div
----closing tags
Here's the CSS:
* {
padding: 0;
margin: 0;
border: 0;
font-weight: normal;
vertical-align: baseline;
}
*,
*:before,
*:after {
-webkit-box-sizing: inherit;
box-sizing: inherit;
}
html {
-webkit-box-sizing: border-box;
box-sizing: border-box;
height: 100%;
}
body {
background: linear-gradient(90deg, #1b1f2a 1.2%, #191d28 1%) 1px 0, #fff;
background-size: 240px 1px;
overflow-x: hidden;
}
header {
height: 100vh;
}
header nav {
display: -ms-grid;
display: grid;
-ms-grid-columns: 1fr 4fr 1fr;
grid-template-columns: 1fr 4fr 1fr;
grid-template-areas: "brand links email";
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
width: 95%;
margin: 50px auto 30px auto;
padding: 10px auto;
}
So if I change the header nav top margin to 0 there's no overflow.
Here's a link to the actual project: https://www.generationz.dev/projects/portfolio1/index.html
So to clarify the question: How do I to set the header section to be 100% of the viewport without any overflow?
Thank you.