CSS Hacks for IE and IE can also be perfect

Source: Internet
Author: User

Mastering CSS Hacks is a basic skill of front-end development engineers. With the advent of browser versions, we are looking for CSS writing that best matches the performance of various browsers. Of course, CSS Hacks is the most popular solution. However, for IE, three major versions of IE6, IE7, and IE8 will be available soon. Here, IE is a cup.

Of course, there are many people hysterical slander IE6. What mango wants to say here is that all the statements that slander IE6 are paper tigers. Looking at the history of IE6, it is by no means an error. IE7/IE8 versions with serious sequelae are the culprit of all cups. The following is the CSS Hacks statement for each IE version:

IE6:

_ Selector {property: value ;}
Selector {property: value; property: value! Important;} // IE6 does not support the same selector! ImportantIE7:

+ Selector {property: value;} IE8:

Selector {property: value \ 0;} IE6 & IE7:

* Selector {property: value;} IE6 & IE7 & IE8:

Selector {property: value \ 9;} sadly, IE8 renders the page in IE7 mode. Currently, the compatibility of multiple IE versions is usually enabled by setting the X-UA-Compatible HTTP header, which can reduce the workload of debugging IE to a certain extent. The Code is as follows:

<Meta http-equiv = "X-UA-Compatible" content = "IE = 7"> // standard IE7 Mode
<Meta http-equiv = "X-UA-Compatible" content = "IE = EmulateIE7"> // you may encounter another situation that is Compatible with IE7:

<Meta http-equiv = "X-UA-Compatible" content = "IE = Edge"> // in standard IE mode, IE8 still exists if IE = Edge is not stated compatibility mode rendering, this setting Scheme (IE = Edge) is currently being applied by koubei.

For more information about IE = Edge: http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2008-January/013635.html

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.