CSS implements the code that is compatible with all the browser's div suspension on the side of the page:
Fixed suspension on the side of the Web page effect is very frequent, especially the customer service system or announcement system, CSS provides the Position:fixed property to achieve this function, but IE6 browser does not support, although IE6 fewer users, but after all, there are users in use, Therefore, it is best to achieve compatibility effect, the following is a piece of code that can be compatible with all browsers, and hope to bring help to the needs of friends.
The code is as follows:
<!DOCTYPE HTML><HTML><Head><MetaCharSet= "Utf-8"><Metaname= "Author"content= "http://www.softwhy.com/" /><title>Ant Tribe</title><styletype= "Text/css">* {padding:0;margin:0;}#fixedLayer{width:100px;Line-height:50px;background:#FC6;Border:1px solid #F90;position:fixed; Right:10px;Bottom:10px;}#content{width:100px;Height:1000px;margin:0px Auto;background:Red;}</style><!--[If LTE IE 6]> <style type= "text/css" > HTML {height:100%; overflow:hidden;} body {height:100%; Overflow:au to; } #fixedLayer {position:absolute;} </style> <! [EndIf] -</Head><Body><DivID= "Content"></Div><DivID= "Fixedlayer">Ant Tribe</Div></Body></HTML>
The above code implements our requirements, enabling the div block to hover over the side of the page and be compatible with all browsers.
Related reading:
The 1.position property can be found in the Position Properties section of CSS .
2.<!--[If LTE IE 6]> can be found in CSS statements <!--[if LTE IE 6]><![ A chapter in the role of Endif]--> .
The original address is: http://www.softwhy.com/forum.php?mod=viewthread&tid=11581
For more information, refer to: http://www.softwhy.com/divcss/
CSS implements a code that is compatible with all browser div suspension on the side of the Web page