CSS Font Style

Font Style

font-style The attribute is mainly used to specify italic text.

This attribute can set three values:

  • normal - The text is displayed normally
  • italic - The text is displayed in italic
  • oblique - The text is 'oblique' (oblique is very similar to italic, but supports fewer features)

Example

p.normal {
  font-style: normal;
}
p.italic {
  font-style: italic;
}
p.oblique {
  font-style: oblique;
}

Try It Yourself

Font Weight

font-weight The attribute specifies the thickness of the font:

Example

p.normal {
  font-weight: normal;
}
p.thick {
  font-weight: bold;
}

Try It Yourself

Font Variant

font-variant The attribute specifies whether the text is displayed in small-caps font (small uppercase letters).

In small-caps font, all lowercase letters will be converted to uppercase. However, the font size of the uppercase letters after conversion is smaller than the font size of the original uppercase letters in the text.

Example

p.normal {
  font-variant: normal;
}
p.small {
  font-variant: small-caps;
}

Try It Yourself