簡體   English   中英

Font Awesome 4.1圖標不起作用?

[英]Font Awesome 4.1 Icons not working?

我嘗試將此代碼添加到我的標頭中

<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css">

如果不起作用,則從Font Awesome GitHub添加整個項目

似乎都不起作用。 所有4.1之前的圖標都可以正常加載,但4.1所需的圖標卻不需要(即fa-cube)。 還有其他人遇到這個問題嗎?

您可以使用<i>標記添加Font Awesome 這是您將如何使用它:

HTML:

<div>
    <i class="fa fa-cube"></i>
</div>

您可以在這里看到-> http://jsfiddle.net/Zv8mH/

希望這可以幫助!!!

正如您在發布的CSS文件中看到的那樣:

@font-face {
  font-family: 'FontAwesome';
  src: url('../fonts/fontawesome-webfont.eot?v=4.1.0');
  src: url('../fonts/fontawesome-webfont.eot?#iefix&v=4.1.0') format('embedded-opentype'), url('../fonts/fontawesome-webfont.woff?v=4.1.0') format('woff'), url('../fonts/fontawesome-webfont.ttf?v=4.1.0') format('truetype'), url('../fonts/fontawesome-webfont.svg?v=4.1.0#fontawesomeregular') format('svg');
  font-weight: normal;
  font-style: normal;
}

字體也必須添加到項目中,因為CSS文件引用了它們。

在這里您可以驗證。 工作正常

代碼如下:

<span class="fa fa-cube"></span>
Ensure the following:
1. You have linked the correct stylesheet 
2. You have enclosed the icon class with <i> tag
<i class="fa fa-cubes"></i>

You can find more icons available with fontawesome at http://fontawesome.io/icons/

暫無
暫無

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

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