CSS implements a code that is compatible with all browser div suspension on the side of the Web page

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.