我的设计目前需要大量的 :before
和 :after
选择器。 IE7 不支持这些选择器,所以经过一番挖掘,我现在使用 IE7.js (IE8 版本)。
虽然它确实有效,但存在明显的滞后(大约 15-20 秒)。
谁能推荐一个更快的替代方案,以便我可以在 IE7 中使用 :before
和 :after
伪元素选择器?
最佳答案
我在 css 中使用了这个 CSS hack:
.button {
*zoom: expression(
this.runtimeStyle.zoom="1",
this.insertBefore( document.createElement("div"), this.childNodes[0] ).className="before",
this.appendChild( document.createElement("div") ).className="after"
);
...然后简单地:
.button:before,
.button .before{
...
}
关于css - 有没有更快的方法在 IE7 中提供 ":before"和 ":after"选择器支持?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6569495/