element with a height set to 100% fails to render with its intended height. Why does this occur?
element fills 100% of its parent's height, it is necessary to set the height of all parent elements to 100%. In this case, the and elements need to have their heights set accordingly.
html, body { height: 100%; width: 100%; margin: 0; }
Copy after login
By setting the heights of all parent elements to 100%, the
element is able to inherit its parent's height and, therefore, render with the intended height of 100%.
The above is the detailed content of Why Doesn\'t My 100% Height Div Fill Its Parent Container?. For more information, please follow other related articles on the PHP Chinese website!
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn