Answer the question
In order to leave comments, you need to log in
Conditional comments or brain after brain stopped by
Faced with the fact that when making layouts, you need to use not hacks, but conditional comments. And for some reason I sit in a complete stupor.
Let's say we have a comment:
<!--[if lt IE 8]><link href="ie7.css" rel="stylesheet" type="text/css" /><![endif]-->
Answer the question
In order to leave comments, you need to log in
Because this file will only be read by ie7, there is no need to write * html .myClass there, .myClass
is enough. Of course, this does not eliminate the need for expressions, zoom: 1, tricks for working inline-block and such charms.
All these “treasures” must be removed from main.css and transferred to ie7.css.
Of course (see whatever you want and write there), it’s just that when you take it out, it will be more convenient for you to fix glitches “for IE”, and there will be less garbage in the main file with styles.
I'll try to explain on the fingers. Let's say you're designing a layout. Look at the result in your favorite browser - everything is fine. Open in IE - damn it! The center block has moved 15 pixels to the left! In this case, it is reasonable to use a conditional comment and return the block to the place for IE.
Another case is when you are typesetting and using transparency in the process. Most browsers will understand the opacity selector, but IE will have to use filter: alpha . And you can also write this “IS” selector in the main style file - it will not affect the display of the page in other browsers. In such a case, the conditional comment is redundant.
All examples are fictitious :)
Just include the ie7.css file via conditional comments last, after the common stylesheet. And accordingly, you write in it only those rules that should fix errors in ie7. For example, expressions for transparent png.
I did not quite understand the essence of the question.
Take out in the include file those styles that are needed only for ie6-7. This file will be connected only by these browsers, the rest will ignore it. Naturally, other style files included on the page will also be loaded.
Yes, just look at how it was done at least here: habrahabr.ru/css/1300975367/ie7.css
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question