Is there a CSS solution for having a DIV (D2) filling the remaining parent element height when the DIV above (D1) dynamically changes its size?
|-------------------| |-------------------| |-------------------|
| some content D1 | | some content D1 | | some content D1 |
| + | | more content | | more content |
|-------------------| | + | | even more |
| D2 | |-------------------| | + |
| | | D2 | |-------------------|
| | | | | D2 |
| | | | | |
| | | | | |
| | | | | |
|-------------------| |-------------------| |-------------------|
D1 also has a max-height and overflow: scroll.
In this jsFiddle make the yellow (d2) fill the rest, whatever the dynamic content of d1 is, without using javascript.
I have seen several question but none treat a dynamic height changing of the upper DIV (D1)
- Div to fill remaing vertical space
- How to make a div height to fill available space
- Expand DIV vertically to fill the remaining space in nonfixed height column
- How to fill 100% of remaining height?
- …
I can not use a Javascript solution. TABLEs are also fine instead of DIVs.
