I am attempting to create a design that expands to fill the screen, but allows for scrolling when the content exceeds the available space.
My current approach using basic flexbox
, as suggested in this answer, successfully fills the screen. However, overflowing content causes the entire screen to scroll instead of just the content's container.
If I manually set a height like 200px
for .outer
, I achieve the desired scrolling behavior, but the bottom pane no longer occupies the full screen.
Alternate methods such as using display: table
resulted in the same issue as flexbox.
I also considered adjusting the height of the content pane with calc
, such as:
height: calc(100% - 60px);
However, since the header's height can vary, a fixed value for the calculation is not possible.
I am seeking a CSS-only solution and would prefer to avoid JavaScript window sizing.