我正在使用li::before
删除一些内容,但此代码适用于所有浏览器,但不适用于IE8。为什么?我需要JavaScript解决方案吗?
这是我的代码:
.NewsArchive li::before, .NewsSubMenu li::before {
content: "• ";
display: none !important;
}
答案 0 :(得分:4)
对于CSS1和CSS2伪元素,IE8不支持CSS3's double-colon notation。该表示法仅由IE9 and later和其他浏览器支持。
如果您需要IE8支持,则必须使用单冒号:
.NewsArchive li:before, .NewsSubMenu li:before {
content: "• ";
display: none !important;
}
不需要JavaScript。而你很可能也不需要!important
。