html - 内容 :attr(); not working in IE 10

标签 html css internet-explorer

出于某种原因,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/

相关文章:

css - 方向变化和 screen.width

jquery - 阻止 IE 表单在 jQuery 委托(delegate) 'submit' 操作上提交

javascript - jquery easyui,ie10,ie11,firefox,输入时默认光标位置为0?

.htaccess - 如何阻止 IE 中这种奇怪的自动重新加载

html - 如何更改输入文本选定值的颜色

php - 如何列出目录的所有内容?

php - 我的 WP 博客中的图片在其他网站上不显示

javascript - 链接点击时活跃的li

jquery - Div 类仅隐藏在 jQuery Tab 中

css - 与伪元素水平对齐