您的位置:首页 > Web前端 > BootStrap

bootstrap 使用 glyphicon图标

2017-12-29 11:35 295 查看
到bootstrap官网下载完整版  fonts 文件夹有

下列这些文件:

glyphicons-halflings-regular.eot

glyphicons-halflings-regular.svg

glyphicons-halflings-regular.ttf

glyphicons-halflings-regular.woff

相关的 CSS 规则写在 dist 文件夹内的 css 文件夹内的 bootstrap.css 和 bootstrap-min.css 文件上。

@font-face
{
font-family:
'Glyphicons
Halflings';
src:
url('../fonts/glyphicons-halflings-regular.eot');
src:
url('../fonts/glyphicons-halflings-regular.eot?#iefix')
format('embedded-opentype'),
url('../fonts/glyphicons-halflings-regular.woff')
format('woff'),
url('../fonts/glyphicons-halflings-regular.ttf')
format('truetype'),
url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular')
format('svg');}
.glyphicon
{
position:
relative;
top:
1px;
display:
inline-block;
font-family:
'Glyphicons
Halflings';
-webkit-font-smoothing:
antialiased;
font-style:
normal;
font-weight:
normal;
line-height:
1;
-moz-osx-font-smoothing:
grayscale;}

把这段代码加到bootstrap.css里面即可;

用法:

<span class="glyphicon glyphicon-search"></span>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: