Difference Browser Based CSS

Not sure if this is possible, but just wondering if there is a CSS tool to distinguish between two browsers, i.e. IE6 and IE8, since I have a style that I need to apply, but the value should be different for IE6 and IE8, etc. e.

ul.sf-menu li li.sfHover ul {
   left:            14.3em; /* for IE8 */
   left:            15em;   /* for IE6 */
   top:             0;

}

Anyway, when IE8 is used, use IE8 style on the left and vice versa?

Thank.

+3
source share
7 answers

You can use different css files, with something like this:

<!--[if IE 6]><link rel="stylesheet" type="text/css" href="../CSS/ie6.css" media="screen" /><![endif]-->
<!--[if IE 7]><link rel="stylesheet" type="text/css" href="../CSS/ie7.css" media="screen" /><![endif]-->

Put all your IE6 hacks in one file. When the day comes when IE6 is gone (what a beautiful day!), You can simply delete the link. This is pretty neat and not inside a single CSS file.

+5

html start:

<!Doctype html>
<!--[if IE 6]>
    <html lang="de-DE" class='ie ie6 lte6 lte7 lte8 lte9'>
<![endif]-->
<!--[if IE 7]>
    <html lang="de-DE" class='ie ie7 lte7 lte8 lte9'>
<![endif]-->
<!--[if IE 8]>
    <html lang="de-DE" class='ie ie8 lte8 lte9'>
<![endif]-->
<!--[if IE 9]>
    <html lang="de-DE" class='ie ie9 lte9'>
<![endif]-->
<!--[if !IE]><!-->
    <html lang="de-DE">
<!--<![endif]-->

: HTML 4 <html>, HTML5 <!Doctype html>.

, :

.ie8
{
    top:        10px;
}
.lte7
{
    top:        15px;
}
+4

IE, " ". IE , :

<!--[ie IE 6]>
    ....everything here will only be seen by IE6
<![endif]-->

HTML . , , , , IE.

, HTML, , HTML, .

IE6, , , , , , .

- , , , . , , , , , ..

Modernizr, CSS , , , .

+1

IE6, .

<link rel="stylesheet" type="text/css" href="style" />
<!--[if IE 6]>
    <link rel="stylesheet" type="text/css" href="ie6.css" />
<![endif]-->
0

CSS , CSS - , .

, CSS hacks, .

0

CSS Browser Selector, jQuery, CSS, .

0

http://rafael.adm.br/css_browser_selector/ Browser Selector, javascript.

0

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


All Articles