First there is no difference as such in HTML4/5 lists as far as my knowledge goes. They render the same way so the title of this post is not misleading but I am just trying to stay up with the latest :) Anyway this post shows how to use Font Awesome in your Ordered or Unordered lists. The result will look like this First things first, if your browser does not support CSS pseudo classes then this approach will not work. You will be glad to hear that most of the latest browsers including Chrome, IE, Firefox supports them. If you have don't know what pseudo classes are then go look at this little tutorial http://www.w3schools.com/css/css_pseudo_classes.asp Anyway lets get back on track and see how the above is done. I assume that you correctly have included bootstrap, font awesome files on your HTML5 page. The Markup [crayon-64832cf9070e8571688793/] above is really basic markup that is required. I've added more lines just so it looks nice in the end. Now lets take a look at our CSS The CSS Here is the CSS that is required to give us the required result. [crayon-64832cf9070ee309105660/] The most important bit in the above CSS is the use of psedo class :before and content that should go before each list item. Demo http://jaspreetchahal.org/examples/font-awesome-list.html A near full list of content values is pro Font Awesome Content Values - Quick reference - Without icons though Here is the Content values of icon- fonts, To integrate check this page out http://fortawesome.github.io/Font-Awesome/#integration icon-glass --> "\f000" icon-music --> "\f001" icon-search --> "\f002" icon-envelope --> "\f003" icon-heart --> "\f004" icon-star --> "\f005" icon-star-empty --> "\f006" icon-user --> "\f007" icon-film --> "\f008" icon-th-large --> "\f009" icon-th --> "\f00a" icon-th-list --> "\f00b" icon-ok --> "\f00c" icon-remove --> "\f00d" icon-zoom-in --> "\f00e" icon-zoom-out --> … [Read more...]
Using Font Awesome Icons in HTML5 Lists
Filed Under: CSS, HTML5 Tagged With: Using Font Awesome icons as bullets
Recent Comments