In my design, there is a header with a height of 8rem;
.header {
top: 0;
left: 0;
height: 8rem;
}
Following that, there is a footer with a height of 5rem;
footer
{
width:100%;
height: 5rem;
}
I am attempting to calculate the height of the body content so that it fills 100% of the screen's height. Initially, I tried this:
.body-content{
height: calc(100vh - 8rem - 5rem);
}
However, this calculation did not result in the desired outcome and the height extended beyond the screen. After some experimenting, I found that the following solution worked perfectly:
.body-content{
height: calc(100vh - 15.5rem);
}
But shouldn't it be equal to 100% of the screen's height minus the header's height and footer's height?