Font Awesome V4 - Basic Use Example

Using Font Awesome Icons within a web page is super easy, where we need to include the icon library CDN within the head section of a document and access all icons using the icon classes.

Here is the example, where we have included two Font Awesome Icons from the library.

  • Used the <i> element to include the cubes icon by including the class fa and fa-cubes.
  • Used the <span> element to include the users icon by including the class fa and fa-users.

Run this on IDE

<!DOCTYPE html>
<html>
<head>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body>
    <i class="fa fa-cubes"></i>
    <span class="fa fa-users"></span>
</body>
</html>

Overall

This example helps us understand the basic use of Font Awesome Icons within an HTML document.

Related Links