Image Icons

In this approach, Use <img> tag to add icon in form of image your webpage. Apply CSS to Adjust Size of Icon.

Example: The example below shows how to Add Icons in HTML using Image Icons.

HTML
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8" />
    <meta content="width=device-width, 
                   initial-scale=1.0" name="viewport" />
    <title>
        Image Icon Example
    </title>
    <style>
        .icon {
            width: 24px;
            height: 24px;
        }
    </style>
</head>

<body>
    <!-- Image Icon -->
    <img alt="home icon" class="icon" 
src="https://media.w3wiki.org/wp-content/uploads/20240527124348/zi.png" />
</body>

</html>

Output:

Image Icons



How to Add Icons in HTML?

Adding icons in HTML enhances the visual appeal and usability of web pages. We will explore fou methods including Font Awesome, Bootstrap Icons, Google Icons, and image icons to Add Icons in HTML.

Below are the approaches to Add Icons in HTML:

Table of Content

  • Font Awesome Icons
  • Bootstrap Icons
  • Google Icons
  • Image Icons

Similar Reads

Font Awesome Icons

In this approach, insert an appropriate CDN link to the Font Awesome library inside your HTML document’s section. Use the class name associated with an inline element such as tag to show the required icon....

Bootstrap Icons

In this approach, Include the Bootstrap Icons library using a CDN link in the section. You can display these by using the tag and selecting an appropriate class name....

Google Icons

In this approach, Include the Google Icons library using a CDN link in the section. Use the tag with the class material-icons and specify the icon name....

Image Icons

In this approach, Use tag to add icon in form of image your webpage. Apply CSS to Adjust Size of Icon....