【问题标题】:FontAwesome Icons in css contentcss 内容中的 FontAwesome 图标
【发布时间】:2013-09-27 20:15:32
【问题描述】:

所以我刚刚问了this question,它工作正常。但当我想;如果我尝试将 font-icons 或 glyphs 放入 css 的 content 属性会怎样?

这里是the fiddle。那么这是否可能,我如何获得一个字体很棒的图标来呈现在 css 的内容属性中?

.item a p.new-label span{
  position: relative;
  content: 'NEW'
}
.item:hover a p.new-label span{
  display: none;
}
.item:hover a p.new-label:after{
  content: '\f014';
}

提前感谢您的帮助。

【问题讨论】:

    标签: html css twitter-bootstrap font-awesome


    【解决方案1】:

    您只需在 .item:hover 中设置字体系列即可。

    http://jsfiddle.net/bhlaird/JfGVE/13/

    .item:hover a p.new-label:after {
        font-family:FontAwesome;
        content:'\f014';
    }
    

    【讨论】:

    • 在我的情况下使用引导字体系列完美:'Glyphicons Halflings' 为我做到了
    猜你喜欢
    • 1970-01-01
    • 2017-05-30
    • 1970-01-01
    • 1970-01-01
    • 2018-04-14
    • 2018-02-13
    • 2021-06-01
    • 2020-05-26
    • 2019-04-17
    相关资源
    最近更新 更多