【问题标题】:Icon doesn't change with class change in Firefox or IE图标不会随着 Firefox 或 IE 中的类更改而更改
【发布时间】:2015-08-11 21:59:55
【问题描述】:

我正在尝试通过在角落显示一个图标并更改它来自定义 Bootstrap (v3.3.5) 折叠面板:打开/关闭图标 sn-p。 这是Bootply 中的工作版本。

就我而言,我尝试从其他来源更改图标。 问题是代码在谷歌浏览器上运行良好,但图标/图像不显示在 Firefox 和 InternetExplorer 上。

这是引导程序中的错误,还是可以轻松修复?

谢谢。

【问题讨论】:

  • 这与 Bootstrap 无关。您的 jQuery 正在正确更改这些类。

标签: javascript jquery css internet-explorer firefox


【解决方案1】:

您需要将content css 属性与伪元素一起使用,所以不要:

.icon-close {
    content: url("https://cdn0.iconfinder.com/data/icons/customicondesignoffice5/256/navigate-down.png");
}

试试

.icon-close::before {
    content: url("https://cdn0.iconfinder.com/data/icons/customicondesignoffice5/256/navigate-down.png");
}

Demo

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-01-11
    • 1970-01-01
    • 1970-01-01
    • 2018-07-11
    • 1970-01-01
    • 2023-03-08
    • 2014-10-14
    相关资源
    最近更新 更多