I want to center the section block vertically with the remainder of the available vertical space on the screen. It should be 100vh - (height of navbar), but I don't know how to achieve that in css
I'm currently setting section height: 100vh but this causes the scrollbar to appear
html, body {
margin: 0;
padding: 0;
}
* {
box-sizing: border-box;
}
nav {
display: flex;
justify-content: space-between;
border: 1px solid red
}
section {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100vh;
border: 1px solid blue
}
<html>
<body>
<nav>
<div>
<a>link 1</a>
<a>link 2</a>
<a>link 3</a>
</div>
<div>
<a>download</a>
</div>
</nav>
<section>
<h1>This is Centered Vertically</h1>
<div>
<h3>However height: 100vh causes a scrollbar to appear</h3>
</div>
</section>
</body>
</html>