Bootstrap glyphicons are missing

蓝咒 提交于 2019-12-12 19:28:33

问题


I don't know why, but my glyphicons from Bootstrap (3.3.7) are missing, they are being substituted by a normal and ugly square. Here is an example of code that calls a missing glyphicon:

        <button type="button" class="btn btn-default">
          <span class="glyphicon glyphicon-star" aria-hidden="true"></span> Star
        </button>

And here it is the Bootstrap part that contains glyphicon's font:

 @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');
}

回答1:


you need to update it , use cdn link, add this to your code

 <link href="http://netdna.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">



回答2:


You need to download Bootstrap in this link http://getbootstrap.com.br/getting-started/#download, after download you need to put the fonts in your project. In the new version dont have fonts in Bootstrap package, but you can download in the older version.



来源:https://stackoverflow.com/questions/43036596/bootstrap-glyphicons-are-missing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!