Let's say I have a Header element which has various content that is determining its height rather than a set property. Is it possible to get that height using CSS only? I want that in order to know how much vertical space I have left on the page and size a video div accordingly.
If I had the dimension set manually I could just use height: calc(100vh - headerHeight);
sample:
<header>
<p>something</p>
</header>
<div>
</div>
header {
background-color: yellow;
margin: 0;
}
p {
font-size: 2em;
padding: 0.5em;
margin: 0;
background-color: pink;
}
div {
background-color: blue;
height: 100vh; /* This should adjust so it doesn't overflow-y.*/
}