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里面即可;
用法:
下列这些文件:
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>
相关文章推荐
- 使用bootstrap轮播功能时候,glyphicon图标不显示问题
- Bootstrap 字体图标,下拉列表组件的使用
- 使用bootstrap图标
- 今天在学习bootstrap,在使用字体图标的时候,无法显示
- 关于bootstrap小图标的使用
- BootStrap glyphicon图标无法显示的解决方法
- 修复 Firefox 下本地使用 Bootstrap 3 时 glyphicon 不显示问题
- glyphicon 图标的使用
- 如何使用Bootstrap自带图标
- Bootstrap中的Glyphicon 字体图标
- bootstrap glyphicon图标无法显示
- Bootstrap-Iconpicker 和pjax插件一起使用图标加载问题
- iconfont字体图标的使用方法--超简单! 我之前因为项目用bootstrap比较多,所以使用font awesome字体图标比较多,后来接触到了iconfont,发现想要的什么图标都有,还可以
- bootstrap搜索图标的使用
- bootstrap中的Glyphicon 字体图标应用
- BootStrap glyphicon图标无法显示的解决方法
- 解决bootstrap中glyphicon无法显示图标只显示方框的问题
- 使用bootstrap图标做链接
- 使用了最新的bootstrap框架,结果在IIS6上无法显示图标
- Bootstrap3 input输入框插入glyphicon图标的方法