简体   繁体   English

如何<a>在引导程序中</a>添加<a>指向图标</a>的<a>链接?</a>

[英]How do I add an <a> link to an icon in bootstrap?

I have the following: 我有以下几点:

<a href="http://www.website.com" title="Website name">Website Link</a>

and

<i style="margin-right: 0.5em; color: #EEEEEE;" class="icon-home icon-4x"></i>

Can someone explain to me how I can combine these in bootstrap with font awesome icons that I am using. 有人可以向我解释如何将这些内容与我正在使用的超棒字体图标结合使用。 Do I put the <a> inside the <i> or the <i> inside the <a> or do the both need to be inside a <div> ? 我是将<a>放在<i>还是<i>放在<a>内,还是两者都必须放在<div>

Put the <i> inside the <a> <i>放入<a>

For Instance, 例如,

<a href="http://www.website.com" title="Website name"><i style="margin-right: 0.5em; color: #EEEEEE;" class="icon-home icon-4x"></i>Website Link</a>

With this, only the icon will show: 这样,只有图标将显示:

<i style="margin-right: 0.5em; color: #EEEEEE;" class="icon-home icon-4x"></i>

With this, a text link will be displayed: 这样,将显示一个文本链接:

<a href="http://www.website.com" title="Website name">Website Link</a>

If you want to display the text and icon with them both being a link then use the following, which puts the i tag inside the a tag: 如果要显示文本和图标,并且它们都是链接,则使用以下命令,它将i标签放在a标签内:

<a href="http://www.website.com" title="Website name"> <i style="margin-right: 0.5em; color: #EEEEEE;" class="icon-home icon-4x"></i>Website Link</a>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM