Reprinted. You must master the simplest CSS hack skills about IE6, IE7, and ff.

Source: Internet
Author: User
Many articles about CSS hack are mentioned in 52css.com.
Csser must master the simplest hack skills about IE6, IE7, and ff.
You can also refer to the following article
Http://www.52css.com/search.asp? Searchcontent = hack

FF Browser

Example source code [www.52css.com]. Test {
Height: 20px;
Background-color: orange;
}

Internet Explorer 7

Example source code [www.52css.com] * + html. Test {/* IE7 */
Height: 20px;
Background-color: blue;
}

Internet Explorer 6

Example source code [www.52css.com] * html. Test {/* IE6 */
Height: 20px;
Background-color: black;
}

The above CSS Code shows that FF is the most obedient browser.
In IE6 and IE7, if you want to use hack, you must add the class tag HTML to the front.
This is a good memory. IE6 adds * HTML, while IE7 adds * + HTML, which implies adding a version.
The advantage of CSS hack for class and ID is that it is easy for management and other personnel to accept without taking into account the order,
You can also use this hack to implement version control similar to the JS browser.

After reading the above content, you can click the following effect to see the effect in different browsers,
Orange indicates ff, blue indicates IE7, and black indicates IE6.

Compatible browser versions: ie5.0, ie5.5, ie6.0, ie7.0, firefox1.5, and firefox2.0

Example source code [www.52css.com] # test {
Width: 300px;
Height: 100px;
Background: # DDD! Important;/* FF */
Background: # ff0;/* ie5.0 */
}
# Test/* ie5.5 + */{
* + Background: # c0f! Important;/* ie7.0 */
* Background: # f00;/* ie6.0 */
* Background/* ie5.5 */: # f90;
}

 

You can test it on your own!

 

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.