"Using Font Awesome Icons without JS"
Bootstrap 3.1.0 Snippet by mrmccormack

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<link href="//netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<!-- SUBMITTED: Marach 29, 2014 12:45pm -->
<!--
Paste the following code into the <head> section of your site's HTML.
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
For example on Bootsnipp.com, we will place it here (despite generating a W3C validation error.
-->
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
<div class="container">
<div class="row">
<div class="col-md-12">
<h1><i class="fa fa-flag"></i>·Using Font Awesome Icons <small>without JS</small></h1>
<p><span class="lead">The iconic font designed for Bootstrap</span></p>
<p>
<a href="http://fortawesome.github.io/Font-Awesome/examples/" target="_blank">Font Awesome on Github</a>
···
<a href="http://css-tricks.com/examples/IconFont/" target="_blank">CSS Tricks for Font Awesome</a>
···
<a href="http://fontawesome.io/icons/" target="_blank">All icons</a>
</p>
</div> <!-- /.col-md-12 -->
</div> <!-- /.row -->
<!-- Example row of columns -->
<div class="row">
<div class="col-md-4">
<h2>Icon sizes</h2>
<hr>
<p><i class="fa fa-camera-retro fa-lg"></i> fa-camera-retro</p>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
/*
Ref: (bottom of page)
http://fortawesome.github.io/Font-Awesome/examples/
*/
.rating{unicode-bidi:bidi-override;direction:rtl;font-size:30px}.rating span.star{font-family:FontAwesome;font-weight:normal;font-style:normal;display:inline-block}.rating span.star:hover{cursor:pointer}
.rating span.star:before{content:"\f006";padding-right:5px;color:#999}
.rating span.star:hover:before,.rating span.star:hover~span.star:before{content:"\f005";color:#e3cf7a}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments:

It was absolutely unnecessary to copy & paste stuff from the font awesome web page. Their explanation of the usage is perfectly understandable and extremely easy.

n0de () - 10 years ago - Reply 0