[英]Bootstrap glyphicons are missing
我不知道為什么,但是我的 Bootstrap (3.3.7) 中的字形不見了,它們被一個普通的和丑陋的正方形取代。 以下是調用缺失字形的代碼示例:
<button type="button" class="btn btn-default">
<span class="glyphicon glyphicon-star" aria-hidden="true"></span> Star
</button>
這是包含 glyphicon 字體的 Bootstrap 部分:
@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');
}
您需要更新它,使用 cdn 鏈接,將其添加到您的代碼中
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
您需要在此鏈接https://getbootstrap.com/docs/4.5/getting-started/download/下載 Bootstrap,下載后您需要將字體放入您的項目中。 在新版本中,Bootstrap 包中沒有字體,但您可以在舊版本中下載。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.