CSS - Web Fonts

CSS Web Fonts

Web fonts give room for web developers to make use of fonts not installed on the user's computer device. We use the @font-face rule for this.

There are different font-formats which includes:

  • True Type Fonts (TTF)
  • Open Type Fonts (OTF)
  • Web Open Font Format (WOFF)
  • Embedded OpenType Font (EOT)

How To Use Web Fonts

  • Specify the @font-face
  • Define the font-family property name and value
  • Define the src property and value.
  • src is the location of the address of the font.
  • Reference the font to the HTML element that you want it to be applied to, by using the same font family property and value
tips
TIP:

URL should always be in small letters (lowercase)
font-weight, font-variant and other font property can be specified inside the @font-face rule, and it will be referred according with only its name

ADVERTISEMENTS

LEARNING IS A CONTINOUS PROCESS - PRACTICE MAKES PERFECT