Home >Web Front-end >CSS Tutorial >Why Doesn't My Child DIV Inherit 100% Height From Its Floated Parent?
Enforcing 100% Height for Child DIV Within Floated Parent
In the provided HTML and CSS, the inner DIV's height remains at 0px despite efforts to declare it as 100% of the parent's height.
Solution:
To resolve this issue, the parent DIV, "outer," requires a "display: flex" property to enable flexbox functionality:
#outer { display: flex; }
Flexbox introduces support for flexible layouts, allowing the inner DIV, "inner," to expand vertically and occupy the full height of its parent.
Additional Considerations:
The above is the detailed content of Why Doesn't My Child DIV Inherit 100% Height From Its Floated Parent?. For more information, please follow other related articles on the PHP Chinese website!