簡體   English   中英

Bootstrap 3.2.0 Glyphicons不工作

[英]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圖標:

  1. 從最近從http://getbootstrap.com下載的代碼中為您的項目添加字體文件夾

 <span class="glyphicon glyphicon-user"></span> 
在此輸入圖像描述

謝謝!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM