CSS Icons are used to enhance the visual appearance of a webpage by adding symbols, images, or font-based icons. There are multiple ways to include icons in a webpage using CSS.
Method | Description |
---|---|
Font Icons (e.g., Font Awesome, Bootstrap Icons) | Uses a font library to display scalable icons as text. |
CSS Background Images | Uses background-image to display an icon. |
SVG Icons | Uses Scalable Vector Graphics (SVG) for high-quality icons. |
Unicode Characters | Uses Unicode codes to display basic symbols. |
Font Awesome is a popular icon library with thousands of icons.
1️⃣ Include Font Awesome CDN in HTML
<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
</head>
2️⃣ Use an Icon in HTML