Why is Font Awesome only showing a square?

为君一笑 提交于 2019-12-11 20:16:23

问题


I am trying to replicate the page linked from Start Bootstrap. All goes fine with the exception of the font-awesome.min.css images.

I am using the same version of font-awesome.min.css and the same code. My code contains the following, which is taken directly from the page's source code:

<i class="fa fa-fw fa-check"></i>
<i class="fa fa-fw fa-gift"></i>
<i class="fa fa-fw fa-compass"></i>

These images are supposed to be shown under the "Welcome to Modern Business" as a checkmark, gift, and compass, respectively. You can see the link above to view it in context, but this image should explain sufficiently:

However, in my page, all of these images are shown up as boxes:

I cannot figure out why the website linked above pulls the correct images from font-awesome.min.css, but my page is not. I have not changed anything from the original source. I created an identical hierarchy, and copy and pasted the .css and .js files directly from the source as well. I have stumbled across this issue before, and I ended up deleting the images because I could not find a solution. I am hoping to have better luck this time around. Any suggestions on what I am doing wrong?


回答1:


Paste this link to the <head> of the document:

<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">

Check if it works.

  • Go to: http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css
  • Copy all of the code there.
  • Create a fontawesome.min.css and store it in your css folder.
  • Try this:

<link rel="stylesheet" href="css/fontawesome.min.css">


来源:https://stackoverflow.com/questions/29927276/why-is-font-awesome-only-showing-a-square

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!