what does \ mean in a css hex color notation?

前端 未结 2 1896
心在旅途
心在旅途 2021-01-04 04:52

I\'m curious what something like this means in CSS:

background-color: #080808 \\9;

I know the hex c

相关标签:
2条回答
  • 2021-01-04 04:58

    That's an old Internet Explorer hack

    \9 hack WORKS for: IE8 IE8 Standards, IE8 IE7 Standards, IE8 Quirks mode, IE7 Quirks, IE7 Standards (all varieties of IE8), IE6

    So, in short, if you want an IE CSS hack that works in all flavors of IE, use the backslash-nine hack.

    source

    0 讨论(0)
  • 2021-01-04 05:11

    2 CSS Rules Specific to Explorer (IE CSS hacks)

    Another option is to declare CSS rules that can only be read by Explorer. For example, add an asterisk (*) before the CSS property will target IE7 or add an underscore before the property will target IE6. However, this method is not recommended because they are not valid CSS syntax.

    IE8 or below: to write CSS rules specificially to IE8 or below, add a backslash and 9 (\9) at the end before the semicolon.
    

    Found here. I must give credit to @Zoltan because I didn't know what to google till he posted.

    It also has some other examples of IE specific web stuff. Like conditional comments which help when wanting to load things only in IE to handle IE unique cases.

    0 讨论(0)
提交回复
热议问题