[ACCEPTED]-Does < form > break height:100%?-forms

Accepted answer
Score: 13

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 #containers height is 0.

Score: 7

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.

Score: 2

try,

<style type="text/css">
        html, body, form
        {
            height: 100%;
            overflow: hidden;
        }

or

<div id="container">&nbsp;</div>

to identify html behave

0

Score: 2

Just

form {
   overflow: hidden;
}

0

More Related questions