IE 6,7,8,9 Compatibility CSS Styles

Development for all browsers, and the struggle for compatibility with IE is a well-known step in the entire process of website development.

Not being a web integrator, do you know any common compatibility stylesheet that is good for IE (in my case, only IE7 bothers me, but I will allow you to open the question for all versions)

+4
source share
2 answers

normalize.css is a good reset that affects a lot of cross browser issues. http://necolas.github.com/normalize.css/

Twitter Bootstrap is good if you want off-the-shelf components. It is compatible with IE. If you decide to use Bootstrap, its reset is actually adapted from normalize.css (so you won’t need both)

The HTML5 Boilerplate can also help with some good practices if you are starting from scratch: https://github.com/h5bp/html5-boilerplate

In particular, I would recommend using HTML5BP conditional comments for target versions of IE, for example:

<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--> <!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]--> <!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]--> <!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]--> 

This means that in your CSS you can solve problems with the version of IE using classes:

 .lt-ie8 .awesome-component { ... } 

Finally, I would recommend AGAINST to use javascript-type policies such as CSS3PIE. In my experience, they just cause more trouble than they are worth, adding unnecessary markup.

Learn a little about graceful deterioration / progressive improvement.

Another answer mentions IE7.js, which I think is fine, although I cannot remember how useful it is. You definitely need to skip the missing JS functions (if you use js), for example Array.indexOf, in IE <= 8. I just found this ECMAScript5 gasket, which looks pretty good: https://github.com/kriskowal/es5-shim

+5
source

I usually use Eric Meyer CSS reset (http://meyerweb.com/eric/tools/css/reset/), which is a good simple starting point.

You can also consider using ie7js (http://code.google.com/p/ie7-js/), which uses JavaScript so that other versions of IE can behave better.

+1
source

Source: https://habr.com/ru/post/1447368/


All Articles