forward slash in CSS? Is this some browser specific thing?

偶尔善良 提交于 2019-12-05 09:23:16
Nathaniel B

It's to target LTE IE7. This hack isn't known as much as the IE6 underscore one.

    #myelement {
background:red; /*Should show as red in all browsers, expect IE6 and IE7 because...*/
/background:yellow; /*IE7 should have yellow*/
_background:green; /*IE6 should have green*/
}

You can make the backslash almost anything you want really, expect the underscore _ as that will target IE6. I use the $ personally.

EDIT:
I've included the IE6 trick too there, as anything IE7 and below will take the / property unless you also have an _ property too.

To target IE8, IE7, and IE6 you need to have that order above.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!