I am currently designing a webpage layout that consists of a header navigation, two rows of banner images, and additional content divs below the banners.
My goal is to set the height of the navigation bar at 90px, with the two rows of banners evenly dividing the remaining viewport height of the user's browser. Additionally, I want the following divs below the banners to have fixed pixel heights.
Below is an excerpt from my simplified code:
html, body {
margin: 0;
padding: 0;
}
.nav {
background: red;
height: 90px;
display: flex;
justify-content: center;
align-items: center;
}
.banners-row-1 {
background: green;
display: flex;
justify-content: center;
align-items: center;
height: 50vh;
}
.banners-row-2 {
background: orange;
display: flex;
justify-content: center;
align-items: center;
height: 50vh;
}
.mailing-list {
height: 115px;
background: pink;
display: flex;
justify-content: center;
align-items: center;
}
.footer {
height: 117px;
background: lightblue;
display: flex;
justify-content: center;
align-items: center;
}
<div class="nav">
This is the nav
</div>
<div class="banners-row-1">
Banners Row 1
</div>
<div class="banners-row-2">
Banners Row 2
</div>
<div class="mailing-list">
Mailing List
</div>
<div class="footer">
Footer
</div>
Although the banner rows are currently set to 50vh, which is almost what I need, I am wondering if there is a way to factor in the 90px height of the navigation bar when calculating the viewport height for the banner divs?
In essence, I am looking for a solution where the banner rows occupy 50% of 'viewport height minus 90px'...?
Thank you