Html 字体真棒图标不起作用
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20985396/
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
Font awesome icons not working
提问by user972255
I am trying to add a font awesome icon in front of my Delete & Settings link button but its not working. Can someone please tell me what is missing?
我正在尝试在我的“删除和设置”链接按钮前添加一个很棒的字体图标,但它不起作用。有人可以告诉我缺少什么吗?
Html Code:
html代码:
<div class="jumbotron">
<p>
<a class="btn btn-danger" href="#">
<i class="fa fa-trash-o fa-lg"></i> Delete
</a>
<a class="btn btn-default btn-sm" href="#">
<i class="fa fa-cog"></i> Settings
</a>
</p>
</div>
Added these css:
添加了这些css:
1) bootstrap.min.css 2) font-awesome.min.css
1) bootstrap.min.css 2) font-awesome.min.css
Also, please see the fiddlehere.
另外,请参阅此处的小提琴。
回答by Cilan
This is a bug in 3.2.1
for site URLs, fixed in 4.0.3
. Replace the link external link with http://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css
这是3.2.1
站点 URL 中的错误,已在4.0.3
. 将链接外部链接替换为http://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css
(In HTML, it would be <link rel="stylesheet" href="http://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css">
)
(在 HTML 中,它是<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css">
)
回答by Mr. HK
Try with this..
试试这个..
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"/>
<div class="jumbotron">
<p>
<a class="btn btn-danger" href="#">
<i class="fa fa-trash-o fa-lg"></i> Delete
</a>
<br>
<a class="btn btn-default btn-sm" href="#">
<i class="fa fa-cog"></i> Settings
</a>
</p>
</div>
回答by user3664663
I had same problem as yours and I followed the solution from Wobuffetbut it was not working.
我和你有同样的问题,我遵循了Wobuffet的解决方案,但它不起作用。
I added title =""
to the element and it fixed my issue:
我添加title =""
到元素并解决了我的问题:
<i class="fa fa-pencil" title="Edit"></i>