<?xml version="1.0" encoding="utf-8"?>

Adding icon library with CSS

Adding icon library with CSS Bad Practice
Adding icon library with CSS Best Practice

Visual content like icons in navigation menus or alongside important information can be a great advantage. Luckily, nowadays, you don't need to create icons from scratch — you can just link an icon library like Google Material Icons, Font Awesome, and Bootstrap Icons without downloading or installing anything.

Adding icons from the library requires several steps:

  1. Link the CSS file of the icon library in the <head> tag
  2. Create an <i> element with the class material-icons
  3. Search for the icon's name on the library's website
  4. Add the icon's name between the start and the end tags

Because icon libraries are actually fonts, you can use CSS styles to adjust the icon's size, color, and shadow, just like for any other text on the web page.

Improve your UX & Product skills with interactive courses that actually work