0

I added font awesome to my html but just figured that I would be better if add it through css instead because otherwise I'll have to add in each and every tag if I want it in multiple tags as my html code shows:

<ul>
    <li><strong><p>SERVICES</p></strong></li>
    <li><a href="#"><i class="fa fa-caret-right" aria-hidden="true"></i> Financial</a></li>
    <li><a href="#"><i class="fa fa-caret-right" aria-hidden="true"></i> Medical</a></li>
    <li><a href="#"><i class="fa fa-caret-right" aria-hidden="true"></i> Insurance</a></li>   
</ul>

How can I add those icons from my style sheet?

Elton Sousa
  • 421
  • 3
  • 10
  • Possible duplicate of [Use Font Awesome Icons in CSS](http://stackoverflow.com/questions/14736496/use-font-awesome-icons-in-css) – AxelH May 27 '16 at 11:20
  • You don't even tried to search... this is the first link found with google, took me 15s. – AxelH May 27 '16 at 11:20

1 Answers1

2

You can do that by inserting FontAwesome icon content property inside of your CSS.

For example:

a:before { 
    font-family: FontAwesome;
    content: "\f095";
}

DEMO

If you don't know how to get icon content, you can copy it from here:

LINK

And after that you can assign this icon to specific a tag, consider using a class instead to make it more specific:

a.class_name:before { 
    font-family: FontAwesome;
    content: "\f095";
}
ghosthunter
  • 193
  • 3
  • 12
  • Exactly... I did not know where to get the content. I will probably have to save that page link cause I might need that until I dont know when. Thanks Ivarz – Elton Sousa May 27 '16 at 11:08