gpt4 book ai didi

css - openweb 图标与 font awesome 图标冲突

转载 作者:行者123 更新时间:2023-11-28 08:41:56 25 4
gpt4 key购买 nike

我使用的是 Font Awesome 图标,效果很好。当我需要更多图标时,我下载了开放式网络图标。现在我将 openweb 图标复制到我的元素及其相关的 css 中。

Font awesome css 有这样的规则..

[class^="icon-"],
[class*=" icon-"] {
font-family: FontAwesome;
font-weight: normal;
font-style: normal;
text-decoration: inherit;
-webkit-font-smoothing: antialiased;
*margin-right: .3em;
}

OpenWeb 图标 css 有这样的规则..

    [class^="icon-"]:before, [class*=" icon-"]:before {
font-family: 'OpenWeb Icons';
font-weight: normal;
font-style: normal;
display: inline-block;
text-decoration: inherit;
vertical-align: center;
font-smoothing: antialiased;
-webkit-font-smoothing: antialiased
}

现在,图标类以“icon-”开头

Example <i class="icon-geo"></i>

现在“icon-”会产生冲突,因为两个图标都基于它制定了自己的规则..我可以在 bugzilla 中看到它..如果我评论了它的一种字体系列,其他字体也可以。

我应该如何克服这个问题..

最佳答案

用不同的标识符在类前/后缀会很容易:

[class^="iconOW-"]:before, [class*=" iconOW-"]:before {
^^ ^^
font-family: 'OpenWeb Icons';
font-weight: normal;
font-style: normal;
display: inline-block;
text-decoration: inherit;
vertical-align: center;
font-smoothing: antialiased;
-webkit-font-smoothing: antialiased
}

然后您可以根据需要将它们包含在不同的类(class)中。

您可能需要考虑多种网络字体整合服务 - fontello.com是一个,它允许您组合不同的图标字体(类似于并包括 font-awesome ),但目前不包括 open web icons您正在使用的字体。

Ping 他们,他们很可能会包含它 - 考虑到字体集提供的值(value)!

关于css - openweb 图标与 font awesome 图标冲突,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19426929/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com