Extracted from the w3c website, here is their official explanation:
Describes a percentage height attribute. This percentage is calculated based on the height of the enclosing block of the generated box. If the height of the container block is not explicitly defined (i.e., it depends on the height of the content), and this element is not in an absolute position, the value will default to 'auto'. A percentage height set on the root element is in relation to the initial container block. Important note: For absolutely positioned elements inside a block-level element, the percentage is measured in relation to the height of the padding box of that element. This is a change from CSS1, where the percentage was always calculated based on the content box of the parent element.
http://www.w3.org/TR/CSS2/visudet.html#propdef-height
Essentially, it will utilize 100% of the available height. If the containing element has a height of 100px, then it will be 100% of 100px, resulting in 100px.
If an element with height:100%
is set with position:absolute
, it will take the height of the nearest parent element with position:relative
, otherwise utilizing the height of the visible window.
It should be noted, as highlighted in another response, that these rules only pertain to block elements (or those with display:block
).