[ACCEPTED]-Does < form > break height:100%?-forms
form
is a block
element, block elements don't have 4 any height unless their content expands 3 or they're explicitly given a height. The 2 closest ancestor of #container
is form
, and it's height 1 is 0
, so #container
s height is 0
.
100% height depends on all ancestors having 8 explicitly declared height. Add a height 7 to the FORM
and your example should work.
HTML, BODY, FORM {
height: 100%;
}
The 6 same holds true for any percentage-based 5 value. If a parent element does not have 4 a height specified its box will be sized 3 based on content. Thus, the child's percentage 2 height will be based on whatever height 1 was calculated for its parent.
try,
<style type="text/css">
html, body, form
{
height: 100%;
overflow: hidden;
}
or
<div id="container"> </div>
to identify html behave
0
Just
form {
overflow: hidden;
}
0
More Related questions
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.