CSS Fonts

Font Style

Font Style

Text that is italicized is often specified using the font-style property.

  • There are three values for this property:
  • Normal displays the text normally; 
  • italic displays the text in italics; and oblique displays the text “leaning” (oblique is extremely similar to italic, but less supported)

Example

				
					p.normal {
  font-style: normal;
}

p.italic {
  font-style: italic;
}

p.oblique {
  font-style: oblique;
}

				
			

Font Weight

A font’s weight is specified using its font-weight property:

Example

				
					p.normal {
  font-weight: normal;
}

p.thick {
  font-weight: bold;
}
				
			

Font Variant

Whether or not a text should be shown in a small-caps font is determined by the font-variant property.

All lowercase letters become uppercase letters when typeset in a small-caps font. But compared to the text’s original uppercase characters, the converted letters have a smaller font size.

Example

				
					p.normal {
  font-variant: normal;
}

p.small {
  font-variant: small-caps;
}
				
			
Share this Doc

Font Style

Or copy link

Explore Topic