Resolving IE6 does not support position:fixed properties

Source: Internet
Author: User

Recently in the optimization of Web site floating ads met IE6 does not support the Position:fixed property. The internet collected a solution

The better solution is to use CSS expressions to solve

Add: CSS expression (CSS expressions), is a way to use the dynamic set CSS properties, and is supported by IE5 above, but the standard mode of IE8 no longer supports CSS expressions

IE7 and above browsers support position:fixed;

I wrote a text about a fixed footer, and I didn't test it under IE6.

Method One

<!--[if IE 6]><style type= "Text/css" >html{overflow:hidden}body{height:100%;overflow:auto;} #gs {position:absolute}</style><! [endif]-->

Advantages: Relatively simple, convenient! On the hack for IE6.

Disadvantage: One page can have only one element is position:absolute otherwise all settings absolute elements will float

Method two using CSS expressions-fixed Bottom

_position:absolute;_bottom:auto;_top:expression (eval (document.documentelement.scrolltop+ document.documentelement.clientheight-this.offsetheight-(parseint (this.currentstyle.margintop,10) | | 0)-(parseint (this.currentstyle.marginbottom,10) | | 0)));

Pros: Very good compatibility with IE6

OK: CSS is also more cost-performance, but better than the use of JS notation

Add: Solve the IE6 vibration bug

* html,* HTML body {background-image:url (about:blank); background-attachment:fixed;}

Resolving IE6 does not support position:fixed properties

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.