我继承了一个CSS样式表,并在一些地方做了类似的事情:
margin:7px 0 0 0;
/margin-top:9px;
Run Code Online (Sandbox Code Playgroud)
要么
background: url(../images/list-hover.png) 0 0 no-repeat;
/background:url(../images/lists-hover.png) 0 2px no-repeat;
Run Code Online (Sandbox Code Playgroud)
有谁知道正斜线在做什么?
小智 7
它是针对LTE IE7的.这个hack并不像IE6强调那么多.
#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*/
}
Run Code Online (Sandbox Code Playgroud)
你可以将反斜杠几乎任何你想要的东西,期望下划线_,因为它将针对IE6.我亲自使用$.
编辑:
我已经包含了IE6技巧,因为IE7及以下版本将采用/属性,除非你也有_属性.
要定位IE8,IE7和IE6,您需要具有上述顺序.