Question:
You have a layout with a #wrapper div containing #first and #second divs. You need to fill the remaining vertical space of #wrapper beneath #first with #second, using only CSS.
Solution:
Flexbox Layout:
Height Control:
Flex-Grow Property:
Code Example:
<code class="css">html, body { height: 100%; margin: 0; } .wrapper { display: flex; flex-direction: column; width: 300px; height: 100%; } .first { height: 50px; } .second { flex-grow: 1; }</code>
The above is the detailed content of How to Fill Remaining Vertical Space in a Wrapper Div with a Second Div Using CSS?. For more information, please follow other related articles on the PHP Chinese website!