- Layer top and bottom
Example of CSS-controlled Div top-and-bottom setting
Layer A and layer B primarily enable IE6 to have the position: fixed; Effect
HtmlCodeAs follows:
<! 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" XML: lang = "ZH-CN" lang = "ZH-CN">
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312"/>
<Meta http-equiv = "content-language" content = "ZH-CN"/>
<Title> Why? </Title>
<Meta name = "Robots" content = "index, follow"/>
<Meta name = "googlebot" content = "index, follow"/>
<Style type = "text/CSS" Media = "screen">
<! --
* {Margin: 0; padding: 0 ;}
Body {margin: 0 auto; Font: 12px/20px tahoma simsun Arial; color: # FFF; Background-color: # FFF; text-align: center ;}
. AAA {width: 150px; Background: Blue; position: absolute; left: 0; top: 0 ;}
. BBB {width: 150px; Background: Blue; position: absolute; Right: 0; top: 0 ;}
. CCC {width: 150px; position: absolute; top: 100%; left: 0; margin-top:-20px; Background: Blue ;}
. DDD {width: 150px; position: absolute; top: 100%; Right: 0; margin-top:-20px; Background: Blue ;}
. AA {width: 50px; position: fixed; Background: black; _ Position: absolute; _ top: expression(eval(document.doc umentelement. scrolltop); Z-index: 1000; left: 0; top: 0 ;}
. Bb {width: 50px; position: fixed; Background: black; _ Position: absolute; _ top: expression(eval(document.doc umentelement. scrolltop); Z-index: 1000; Right: 0; top: 0 ;}
. A {color: #000 ;}
-->
</Style>
</Head>
<Body>
<Div class = "AAA"> AAA </div>
<Div class = "BBB"> BBB </div>
<Div class = "AA"> A </div>
<Div class = "BB"> B </div>
<Div class = "A">
<Br/>
<Br/>
<Br/>
<Br/>
<Br/>
Layer A and layer B move with the scroll bar to the top permanently
<Br/>
<Br/>
<Br/>
<Br/>
<Br/>
<Br/>
<Br/>
<Br/>
<Br/>
<Br/>
<Br/>
<Br/>
<Br/>
<Br/>
<Br/>
<Br/>
<Br/>
<Br/>
<Br/>
<Br/>
<Br/>
<Br/>
<Br/>
<Br/>
</Div>
<Div class = "CCC"> CCC </div>
<Div class = "DDD"> DDD </div>
</Body>
</Html>