Today, I handled a problem of Div height self-adaptation... record...
The effect is that head and foot are fixed, and the content DIV in the middle is highly adaptive...
<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" > < Html Xmlns = "Http://www.w3.org/1999/xhtml" Lang = "ZH-CN" > < Head > < Title > </ Title > < Style Type = "Text/CSS" > HTML, body { Margin : 0 ; Padding : 0 ; } </ Style > </ Head > < Body > < Div Style = "Height: 100px; position: fixed; width: 400px; Background-color: Gray; top: 0 ;" > < H1 > This is top </ H1 > </ Div > < Div Style = "Float: Left; width: 400px; position: absolute; overflow-Y: Scroll; overflow-X: hidden; Background-color: green; top: 100px; bottom: 100px ;" > < BR /> Aaaaaaaaaaaaaaaaaaaa < BR /> Aaaaaaaaaaaaaaaaaaaa < BR /> Aaaaaaaaaaaaaaaaaaaa < BR /> Aaaaaaaaaaaaaaaaaaaa < BR /> Aaaaaaaaaaaaaaaaaaaa < BR /> Aaaaaaaaaaaaaaaaaaaa < BR /> Aaaaaaaaaaaaaaaaaaaa < BR /> Aaaaaaaaaaaaaaaaaaaa < BR /> Aaaaaaaaaaaaaaaaaaaa < BR /> Aaaaaaaaaaaaaaaaaaaa < BR /> Aaaaaaaaaaaaaaaaaaaa < BR /> Aaaaaaaaaaaaaaaaaaaa < BR /> Aaaaaaaaaaaaaaaaaaaa < BR /> Aaaaaaaaaaaaaaaaaaaa < BR /> Aaaaaaaaaaaaaaaaaaaa < BR /> Aaaaaaaaaaaaaaaaaaaa < BR /> Aaaaaaaaaaaaaaaaaaaa < BR /> Aaaaaaaaaaaaaaaaaaaa < BR /> Aaaaaaaaaaaaaaaaaaaa < BR /> Aaaaaaaaaaaaaaaaaaaa < BR /> Aaaaaaaaaaaaaaaaaaaa < BR /> Aaaaaaaaaaaaaaaaaaaa < BR /> Aaaaaaaaaaaaaaaaaaaa < BR /> Aaaaaaaaaaaaaaaaaaaa < BR /> Aaaaaaaaaaaaaaaaaaaa < BR /> Aaaaaaaaaaaaaaaaaaaa < BR /> Aaaaaaaaaaaaaaaaaaaa < BR /> Aaaaaaaaaaaaaaaaaaaa < BR /> Aaaaaaaaaaaaaaaaaaaa < BR /> Aaaaaaaaaaaaaaaaaaaa < BR /> Aaaaaaaaaaaaaaaaaaaa < BR /> Aaaaaaaaaaaaaaaaaaaa < BR /> Aaaaaaaaaaaaaaaaaaaa < BR /> Aaaaaaaaaaaaaaaaaaaa < BR /> Aaaaaaaaaaaaaaaaaaaa < BR /> Aaaaaaaaaaaaaaaaaaaa < BR /> Aaaaaaaaaaaaaaaaaaaa < BR /> Aaaaaaaaaaaaaaaaaaaa < BR /> Aaaaaaaaaaaaaaaaaaaa < BR /> Aaaaaaaaaaaaaaaaaaaa < BR /> Aaaaaaaaaaaaaaaaaaaa < BR /> Aaaaaaaaaaaaaaaaaaaa < BR /> Aaaaaaaaaaaaaaaaaaaa < BR /> Aaaaaaaaaaaaaaaaaaaa < BR /> Aaaaaaaaaaaaaaaaaaaa < BR /> Aaaaaaaaaaaaaaaaaaaa < BR /> Aaaaaaaaaaaaaaaaaaaa < BR /> Aaaaaaaaaaaaaaaaaaaa < BR /> Aaaaaaaaaaaaaaaaaaaa < BR /> Aaaaaaaaaaaaaaaaaaaa </ Div > < Div Style = "Height: 100px; position: fixed; width: 400px; Background-color: Gray; bottom: 0 ;" > < H1 > This is bottom </ H1 > </ Div > </ Body > </ Html >
The effect is that the content div is highly adaptive.