CSS Icons

We can add icon to our HTML page CSS icon libraries such as font awesome , Bootstrap icons and material icon by google.

To add icons we should use HTML inline elements 

EXAMPLE: <span> or <i>

Font awesome  icon: To use font awesome icons we need to include the library  to our HTML page using the <link> tag with its <href> attribute containing the <url> of the library.

The <link> tag should be inside the <head> element.

EXAMPLE

                         

<!DOCTYPE html>
<html>
<head>
<script src="https://kit.fontawesome.com/a076d05399.js" crossorigin="anonymous"></script>
</head>
<body>

<i class="fas fa-cloud"></i>
<i class="fas fa-heart"></i>
<i class="fas fa-car"></i>
<i class="fas fa-file"></i>
<i class="fas fa-bars"></i>

</body>
</html>

Bootstrap icon:You can place icons just about anywhere using the CSS Prefix fa and the icon’s name. Icons are designed to be used with inline elements (we like the <i> tag for brevity, but using a <span> is more semantically correct).

EXAMPLE

 

<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
</head>
<body>

<i class="glyphicon glyphicon-cloud"></i>
<i class="glyphicon glyphicon-remove"></i>
<i class="glyphicon glyphicon-user"></i>
<i class="glyphicon glyphicon-envelope"></i>
<i class="glyphicon glyphicon-thumbs-up"></i>

</body>
</html>