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.
<!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:
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