出于某种原因,IE 无法获取如下设置的内容:attr(data-title)。 尽管在 FF 和 Chrome 中工作。
如何解决这个问题?
<a href="#" class="nav-roll">
<span data-title="About">About</span>
</a>
.nav-roll span:after {
background: none repeat scroll 0 0 #0198cd;
color: #FFF;
content: attr(data-title);
display: block;
padding: 0 2px;
position: absolute;
left: 0;
top: 0;
}
最佳答案
您还没有添加 <!DOCTYPE html>
到 HTML 文件的顶部,迫使 IE 进入 Quirks 模式。 IEQuirks 不支持 :after
完全没有。
关于html - 内容 :attr(); not working in IE 10,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15486879/