Html Font Awesome 图标根本不显示

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/25677184/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 02:38:49  来源:igfitidea点击:

Font Awesome Icons not showing up at all

htmlcsstwitter-bootstrapfont-awesome

提问by aritroper

I am working with bootstrap and am using chrome. I put the following code in my HTML file to import FontAwesome.

我正在使用引导程序并使用 chrome。我将以下代码放在我的 HTML 文件中以导入 FontAwesome。

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

And then put in the following icon.

然后放入下面的图标。

<i class="fa fa-search"></i>

Nothing showed up at all! When I inspect element, it's a 0x0 text. No height no width. It doesn't show up at all.

什么都没有出现!当我检查元素时,它是一个 0x0 文本。没有高度没有宽度。它根本不显示。

回答by Sean

If you are testing it locally add http: to the beginning of you href value.

如果您在本地测试它,请将 http: 添加到您的 href 值的开头。

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