2016-02-16 98 views
0

我目前使用下面的代碼與我的頭,以顯示一對夫婦glyphicons(glyphicon-字形向下和glyphicon-刪除-SIGN):的字體重寫glyphicon代碼真棒

<h2 class="h2Article collapsed" id="a4" data-toggle="collapse" data-target="#b4" aria-expanded="false"><span class="Article"><span class="label label-primary"><small><span class="only-collapsed glyphicon glyphicon-chevron-down"></span><span class="only-expanded glyphicon glyphicon-remove-sign"></span></small> Acquired LifeTags</span></span></h2> 

我剛剛發現字體真棒的最新圖書館,並想嘗試一下。我應該如何修改上面的代碼來替代glyphicon-chevron-down?

<i class="fa fa-chevron-down fa-2x"></i> 

P.S.我應該補充一點,如果可能的話,我想簡化我的代碼。四個單獨的跨度太多了。 ;)

+0

附註:P

你應該像這樣結束了調用Font Awesome的字符glyphicons是正確的,還是glyphicons和Font Awesome兩個不同的東西? –

+0

https://fortawesome.github.io/Font-Awesome/ vs http://glyphicons.com/;兩個不同的東西 – Blag

回答

1

更換

<span class="only-collapsed glyphicon glyphicon-chevron-down"></span> 

通過

<i class="only-collapsed fa fa-chevron-down fa-2x"></i> 

沒有更多:

<h2 class="h2Article collapsed Article label label-primary" id="a4" 
    data-toggle="collapse" data-target="#b4" aria-expanded="false"> 
    <small> 
     <i class="only-collapsed fa fa-chevron-down fa-2x"></i> 
     <i class="only-expanded glyphicon glyphicon-remove-sign"></i> 
    </small> 
    &nbsp;Acquired LifeTags 
</h2>