CSS · CSS Tutorial · Lesson 16
CSS Icons
Add icons with icon fonts or inline SVG.
Icons can be added with an icon library (Font Awesome, Bootstrap Icons, Google Material Icons) or with inline SVG. Icon fonts can be styled with CSS like text: size, color, shadow.
Example
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css">
<i class="fa-solid fa-cloud"></i>
<i class="fa-solid fa-heart" style="color:red; font-size:32px;"></i>
<i class="fa-solid fa-car" style="font-size:48px; color:#04AA6D;"></i>
Inline SVG icon
Example
<svg width="40" height="40" viewBox="0 0 24 24" fill="tomato">
<path d="M12 21s-7-4.5-9.5-9A5.5 5.5 0 0 1 12 6a5.5 5.5 0 0 1 9.5 6c-2.5 4.5-9.5 9-9.5 9z"/>
</svg>
Keep reading “CSS Icons”
Sign up to read the full lesson, try every example in the live editor, and take the 5-question quiz.