My element is simply a Header, then Body, then Footer
<div id="my-element">
<div id="header">...</div>
<div id="body">
...
</div>
<div id="footer">...</div>
</div>
Currently #my-element
has been confined to have a max-height of the browser window. #header
and #footer
have variable heights and should never be scrollable elements. #body
is the only element that should be scrollable, and that occurs only when the sum of all 3 heights' exceed that of #my-element
. When that occurs, #body
is the element that gains a scrollbar.
For some reason I suspect that there is some straightforward solution with flexbox, but I'm not familiar with that property and have not been able to find one.