IE conditionally in the stylesheet

I am trying to align the upper border of the contents of a div with the lower borders of the list <li>used for navigation on the right (e.g. tabbed pane). In IE, alignment (or a given field) is disabled by 1 pixel.

Is there any way, directly inside css, so that I don't have to create a separate IE stylesheet to set a condition that will set margins in IE? OR, if the problem that I encounter with IE being disabled by 1 pixel pops up on you, I would like to hear why I can avoid the IE hacker at all (I know that I haven't added the code yet). Thank!

+3
source share
2 answers

Yes there is.

.myclass {   * margin: 1px; }

IE6 IE7, - ?

+3

CSS-, , , . http://www.webdevout.net/css-hacks

, , 2- , (-) , CSS- IE .

HTML div ( IE, )

<body>
<!--[if IE 6]> <div class="IE6"> <![endif]-->
<!--[if IE 7]> <div class="IE7"> <![endif]-->
...
<!--[if IE 7]> </div> <![endif]-->
<!--[if IE 6]> </div> <![endif]-->
</body>

inline IE.

.className { ... some styles ... }
.IE6 .className { ... some styles to fix IE6 only ... }
.IE7 .className { ... some styles to fix IE7 only ... }

, .

+3

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


All Articles