Solve the simplest CSS hack compatible with IE6, IE7, and Firefox

Source: Internet
Author: User

 

I have seen the solution here for a long time. After discussing it with zookeeper, I found that the solution is still very reliable. Of course, the only drawback is that every attribute has to go to hack, but in many practices, I only need to 'modify' 1-2 attributes.

It is easy to write:

# Somenode
{
Position: fixed;
# Position: fixed;
_ Position: fixed;
}

The first line is for Firefox and other browsers.
The second row is for IE7 (maybe the same is true for IE8 and ie9 in the future. Who knows ?)
The third row is for IE6 and older versions.
The best application is to enable IE6 to "support" position: fixed. In addition, with this principle, JavaScript is not introduced.Code(Only IE6 expressions are used.) I have a ready-made page, which is written as follows:

# FF-R
{
Position: fixed;
_ Position: absolute;
Right: 15px;
Top: 15px;
_ Top: expression (eval (document. compatmode &&
Document. compatmode = 'css1compat ')?
Documentelement. scrolltop + 15:
Document. Body. scrolltop +
(Document. Body. clientheight
-This. clientheight ));
}

Is it convenient :)

 

Related Article

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.