CSS | Icons

Icons can be added to our HTML page with icon library. All the icons in the library can be formatted using CSS. They can be customized according to size, color, shadow, etc.
Types of icon library:

  • Font Awesome Icons
  • Google Icons
  • Bootstrap Icons

Note: All the above-mentioned library does not require any downloading or installation.

Font Awesome Icons: To use Font Awesome Icons add the following link inside <head> section.

filter_none

edit
close

play_arrow

link
brightness_4
code

chevron_right


Example 1:

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE>
<html>
   <head>
      <link rel="stylesheet" 
   </head>
   <body>
      <h1>
         GEEKSFORGEEKS
      </h1>
      <i class="fa fa-cloud" style="font-size:32px;"></i>
      <i class="fa fa-heart" style="font-size:32px;"></i>
      <i class="fa fa-file" style="font-size:32px;"></i>
      <i class="fa fa-car" style="font-size:32px;"></i>
      <i class="fa fa-bars" style="font-size:32px;"></i>
   </body>
</html>

chevron_right


Output:


Example 2:

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE>
<html>
   <head>
      <link rel="stylesheet" 
   </head>
   <body>
      <h1>
         GEEKSFORGEEKS
      </h1>
      <i class="fa fa-heart" style="font-size:28px;color:red;"></i>
      <i class="fa fa-heart" style="font-size:30px;color:blue;"></i>
      <i class="fa fa-heart" style="font-size:32px;color:red;"></i>
      <i class="fa fa-heart" style="font-size:34px;color:blue;"></i>
      <i class="fa fa-heart" style="font-size:36px;color:red;"></i>
   </body>
</html>

chevron_right


Output:


Google Icons: To use Google Icons add the following link inside <head> section.

filter_none

edit
close

play_arrow

link
brightness_4
code

<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">

chevron_right


Example 1:

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE>
<html>
   <head>
      <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
   </head>
   <body>
      <h1>
         GEEKSFORGEEKS
      </h1>
      <i class="material-icons">cloud</i>
      <i class="material-icons">favorite</i>
      <i class="material-icons">attachment</i>
      <i class="material-icons">computer</i>
      <i class="material-icons">traffic</i>
   </body>
</html>

chevron_right


Output:


Example 2:

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE>
<html>
   <head>
      <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
   </head>
   <body>
      <h1>
         GEEKSFORGEEKS
      </h1>
      <i class="material-icons"style="font-size:30px;">cloud</i>
      <i class="material-icons"style="font-size:40px;">cloud</i>
      <i class="material-icons"style="font-size:50px;">cloud</i>
      <i class="material-icons"style="font-size:60px;">cloud</i>
      <i class="material-icons"style="font-size:70px;">cloud</i>
   </body>
</html>

chevron_right


Output:

google-icon

Bootstrap Icons: To use Bootstrap Icons add the following link inside <head> section.

filter_none

edit
close

play_arrow

link
brightness_4
code

chevron_right


Example 1:

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE>
<html>
   <link rel="stylesheet" 
   </head>
   <body>
      <h1>
         GEEKSFORGEEKS
      </h1>
      <i class="glyphicon glyphicon-cloud"style="font-size:28px;"></i>
      <i class="glyphicon glyphicon-user"style="font-size:30px;"></i>
      <i class="glyphicon glyphicon-thumbs-up"style="font-size:32px;"></i>
      <i class="glyphicon glyphicon-remove"style="font-size:34px;"></i>
      <i class="glyphicon glyphicon-envelope"style="font-size:36px;"></i>
   </body>
</html>

chevron_right


Output:


Example 2:

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE>
<html>
   <link rel="stylesheet" 
   </head>
   <body>
      <h1>
         GEEKSFORGEEKS
      </h1>
      <i class="glyphicon glyphicon-thumbs-up"style="font-size:20px;"></i>
      <i class="glyphicon glyphicon-thumbs-up"style="font-size:30px;"></i>
      <i class="glyphicon glyphicon-thumbs-up"style="font-size:40px;"></i>
      <i class="glyphicon glyphicon-thumbs-up"style="font-size:50px;"></i>
      <i class="glyphicon glyphicon-thumbs-up"style="font-size:60px;"></i>
   </body>
</html>

chevron_right


Output:

bootstrap-icon



My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.




Article Tags :
Practice Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.