What does it mean to give div style = 'height: 100%'?

There are a lot of questions about SO related to this, but the ones I looked at are for detailed, specific situations. What I want to know, at a conceptual level, what does it mean to say:

<div style='height:100%'>

How high is 100%? 100% of what?

[EDIT]

Follow-up question: if 100% represents the height of the parent, but the parent is equal to <body> and has no height other than the height of the div, then what does that mean? It seems to be recursively defined.

+5
source share
4 answers

100% of the height of the parent container.

See here: http://jsfiddle.net/6VRn6/

If you want to use this method to make a div at 100% of the page height, you must specify the height as 100% of the body and html.

body, html {
  height: 100%;
}

html body, .

, . 200px div 2px 204px, 40px status div. body 244px. , CSS , jsfiddle. . , .

+4

100% offsetParent. . position, static, .

+5

: 100% :     div !

+1

, 100% div class tag . :

{--parent loop { ..height 100% of above loop .. } }

0

All Articles