问题
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