Want to make Font Awesome icons clickable

前端 未结 7 2227
伪装坚强ぢ
伪装坚强ぢ 2020-12-12 23:45

So I am new to web development and I am trying to link font awesome icons to my social profiles but am unsure of how to do that. I tried using an a href tag but it made all

7条回答
  •  情书的邮戳
    2020-12-13 00:20

    If you don't want it to add it to a link, you can just enclose it within a span and that would work.

    in your css, then you can:

    #clickableAwesomeFont {
         cursor: pointer
    }
    

    Then in java script, you can just add a click handler.

    In cases where it's actually not a link, I think this is much cleaner and using a link would be changing its semantics and abusing its meaning.

提交回复
热议问题