本文共 1095 字,大约阅读时间需要 3 分钟。
做网站的时候,看到一个font Awesome字体,里面包含着常用的图片,可以直接在网站上使用
is a web font containing all the icons from the Twitter Bootstrap framework, and now many more. Whilst the implementation in Bootstrap is designed to be used with the<i>
element (Bootstrap v2), you may find yourself wanting to use these icons on other elements. To do so, you'll need to use the following CSS on the desired element, and then substitute in the content value for the relevant icon.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | .element { position : relative ; } /*replace the content value with the corresponding value from the list below*/ .element:before { content : "\f000" ; font-family : FontAwesome; font-style : normal ; font-weight : normal ; text-decoration : inherit; /*--adjust as necessary--*/ color : #000 ; font-size : 18px ; padding-right : 0.5em ; position : absolute ; top : 10px ; left : 0 ; } |
Note: it is not possible to use :before or :after pseudo content on <input>
elements, however if you instead use <button>Label</button>
, it will work as desired.
下面是一个使用了FontAwesome字体的网站角标部分
网站角标的网站:
下载链接:
原文链接: