Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Font-awesome class with multiple different icons

I want to create custom font-awesome class with multiple icons in it, i.e. .2star class consisting of 2 stars and 3 empty stars in a line, beside each other. Is there a way to do it in CSS or I have to use html-only solution with multiple i-classes ?

like image 220
Czarnodziej Avatar asked Oct 19 '25 04:10

Czarnodziej


1 Answers

Yes you create a custom font awesome class, with multiple characters in content like this

.class:after {
   content: "\f005\f005\f005"; /* 3 Stars */
    font-family: FontAwesome;
}

Demo

Note that the values like \f005 etc can be found in FontAwesome stylesheet so copy the unicode of the type of font you like and use it in the content property with the font family of Font Awesome.

like image 76
Mr. Alien Avatar answered Oct 21 '25 19:10

Mr. Alien



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!