CSS - Icons

Icons

In this tutorial, I will be showing you how to add and use icons.

Icons are small graphical representation, symbol or small images.

Adding Icons

Below are the following ways you can add icons to your website.

  • Font Awesome Icons
  • Bootstrap Icons
  • Google Icons
  • Google Icons (Material Icon)
  • SVG
  • Background Images
  • Pseudo Elements

FONT AWESOME ICONS

  • Add the font awesome link inside the <head> tag.
  • Add the name of the icon class to the opening tag of the HTML element: <i> or <span>

BOOTSTRAP ICONS

  • Add the bootstrap link inside the <head> tag.
  • Add the name of the icon class to the opening tag of the HTML element: <i> or <span>

GOOGLE ICONS

  • Add the google link inside the <head> tag.
  • Add the name of the icon class to the opening tag of the HTML element: <i> or <span>

SVG ICONS

  • The <svg> tag is used together with the <path> tag to specify the icon.
  • The d attribute of the <path> tag defines the shape of the path
note
NOTE:

xmlns attribute specifies the address path.
icon class is used to reference the CSS styling.


BACKGROUND IMAGE

  • Use the background-image property to specify the icon address.

PSEUDO ELEMENTS

  • The ::before and ::after pseudo element can be used to insert icon before or after element.
ADVERTISEMENTS

LEARNING IS A CONTINOUS PROCESS - PRACTICE MAKES PERFECT