2017-12-03 110 views
0

我正在使用bootstrap 4.0。 4.0文檔沒有提到圖標,但文檔3.3。我希望有類似這樣的圖標按鈕:獲取glyphicons.css的正確方法是什麼?

<button type="button" class="btn btn-default btn-lg"> 
    <span class="glyphicon glyphicon-star" aria-hidden="true"></span> Star 
</button> 

我從3.3文檔,但它不工作。我做了谷歌的解決方案(12等),做到這一點似乎是手動列出這樣一個文件的方式:

<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-glyphicons.css" rel="stylesheet"> 

不幸的是我無法找到一個4.0版本,但我不想在不知道發生了什麼的情況下像這樣添加它。爲什麼它不包含在bootstraps主頁上的cdn鏈接中?我覺得你應該自己提供這個文件嗎?但是我下載了bootstrap,並且它不在那裏。

enter image description here

我缺少什麼?我想要帶有圖標的按鈕。

+0

爲什麼不使用fontawesome http://fontawesome.io/ – vinsentos

+0

查看[Docs](https://getbootstrap.com/docs/4.0/migration/#components),它們確實涵蓋了Bootstrap 4圖標的刪除。所以使用任何有意義的東西如果您只需要一些圖標,可以查看[Icomoon](https://icomoon.io/)或[Fontello](http://fontello.com/)。 – vanburen

回答

0

使用Font Awesome它真棒!

<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-glyphicons.css" rel="stylesheet"> 
    <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" /> 

<button type="button" class="btn btn-default btn-lg"> 
     <span class="fa fa-star" aria-hidden="true"></span> Star 
</button> 

這應該工作得很好。

這裏是所有圖標列表:http://fontawesome.io/icons/

祝您好運!

+0

我喜歡和下一個人一樣的字體,但我有問題。問題1,是自舉批准的方式嗎?問題2,我實際上需要像一個或兩個圖標。我討厭把所有這些僅僅添加到一些可憐的圖標上。問題3,版本仍然不匹配ಠ_ಠ – user875234

相關問題