html - 内容 CSS 和与 IE 的兼容性

标签 html css internet-explorer

我插入了一个带有图像的图标。

在 chrome 中我看到了图标

enter image description here

但在IE中图标消失。

这是我的 CSS

<div class="infoIcon"></div>

.infoIcon {
    content: url('/assets/img/info-sign.png');
    background-color: #919191;
    width:15px;
    border-radius: 8px;
    margin-left:10px;
    display: inline;
    vertical-align: sub
}

最佳答案

您可以使用 HTML 实体实现此目的。

.infoIcon {
    font-size: 40px;
}
<div class="infoIcon">&#9432;</div>

关于html - 内容 CSS 和与 IE 的兼容性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52421400/

相关文章:

html - Angular Flex 布局挑战

css - 为什么可见性不适用于 div?

css - 在这种情况下如何在 DIV 中插入图像

c# - MVC - 部分 View 不断显示相同的内容

javascript - 通过 javascript 播放 mp4 视频

javascript - 如何将 JSON 数据添加到 HTML 表格

css - 隐藏空选项组

javascript - 在 JS 中的正方形内绘制正方形

css - 文本在 IE 中不显示在图像下方

javascript - CSS 问题 - 我的 DIV 一直处于折叠状态!