[英]Bootstrap 3.2.0 Glyphicons not working
我是bootstrap的新手,它的字形不適合我。 在我檢查代碼之后, glyphicon-user
font-family
是"Helvetica Neue",Helvetica,Arial,sans-serif
而不是Glyphicons Halflings
。 我錯過了什么或者我需要更改css
文件。
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" href="css/bootstrap.min.css"/>
<link rel="stylesheet" href="css/bootstrap-theme.min.css"/>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
</head>
<body>
<form>
<div class="row">
<div class="col-xs-4">
<div class="input-group">
<span class="input-group-addon">
<span class="glyphicon-user"></span>
</span>
<input type="text" class="form-control" placeholder="Username"/>
</div>
</div>
<div class="col-xs-4">
<div class="input-group">
<input type="text" class="form-control" placeholder="Amount">
<span class="input-group-addon">.00</span>
</div>
</div>
<div class="col-xs-4">
<div class="input-group">
<span class="input-group-addon">$</span>
<input type="text" class="form-control" placeholder="US Dollar">
<span class="input-group-addon">.00</span>
</div>
</div>
</div>
</form>
</body>
</html>
您需要添加類glyphicon
。
所以你的跨度應該是:
<span class="glyphicon glyphicon-user"></span>
如文檔中所示: http : //getbootstrap.com/components/#glyphicons-how-to-use
命名字形是不夠的,你也必須使用類glyphicon
。
<span class="glyphicon glyphicon-user"></span>
另外,請注意您是否在Opera移動模擬器中使用它。 它不能正確支持這些字體,因此您將獲得一個空白方塊。
按照步驟在您的boostrap項目中使用Glyphicons圖標:
<span class="glyphicon glyphicon-user"></span>
謝謝!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.