Font Awesome icons not working as links

霸气de小男生 提交于 2019-12-24 08:49:37

问题


My font awesome icons aren't linking to where I set the href on the a tag. In fact when I inspect them there is no href on the a tag. I have some demo code for you to look at, but on the demo code it does show the href when inspecting it just doesn't link to the page. Maybe if this code is fixed it will fix my issue. Thanks

<a href="https://www.google.co.uk/">
  <i class="fa fa-facebook-official fa-3x" aria-hidden="true"></i>
</a>

<script src="https://use.fontawesome.com/7c396dc5cb.js"></script>

https://jsfiddle.net/znvfbu9g/


回答1:


Provide a target attribute to your a tag.

Something on the lines of:

<a target="_blank" href="https://www.google.co.uk/">
  <i class="fa fa-facebook-official fa-3x" aria-hidden="true"></i>
</a>

Check updated fiddle.




回答2:


Do you have the latest CDN attached to you page to display the icons?

http://fontawesome.io/get-started/



来源:https://stackoverflow.com/questions/43320998/font-awesome-icons-not-working-as-links

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