码迷,mamicode.com
首页 > 其他好文 > 详细

bootstrap字体图标在IE上不显示

时间:2017-10-18 18:31:46      阅读:205      评论:0      收藏:0      [点我收藏+]

标签:解决   -o   hicon   smooth   问题   lin   trap   position   fling   

 

最简单的办法就是直接下载最新的bootstrap.css替换掉旧的。

但是由于我做的项目直接替换会出现样式冲突问题,因此只好慢慢找是什么属性导致图标不显示,最后找到了解决办法:

1.首先保字体文件的位置正确,最好下最新的文件

2.检查font-family属性是否为‘Glyphicons Halflings’,

@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.woff2‘) format(‘woff2‘), 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‘; /*检查这个属性*/
  font-style: normal; font-weight: normal; line-height: 1; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

 

bootstrap字体图标在IE上不显示

标签:解决   -o   hicon   smooth   问题   lin   trap   position   fling   

原文地址:http://www.cnblogs.com/liaokaichang/p/7687848.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!