Font-awesome class with multiple different icons

三世轮回 提交于 2019-12-05 02:23:27

问题


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 ?


回答1:


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.



来源:https://stackoverflow.com/questions/17450616/font-awesome-class-with-multiple-different-icons

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