1. css
  2. /properties
  3. /font-style

font-style

Definition

The font-style CSS property sets the style of the font. It allows you to make text italic, oblique, or normal.

Examples

Make text italic:

font-style: italic;

Make text oblique:

font-style: oblique;

Make text normal:

font-style: normal;

Values

ValueDescription
normalSets the font style to a normal font face.
italicSets the font style to an italic font face. The italic version of a font is designed to look visually distinct from the normal version, and is often used to emphasize text.
obliqueSets the font style to an oblique font face. This is similar to an italic font, but the letters are slanted at an angle rather than being specially designed. Not all fonts have an oblique version, and some that do may not look significantly different from the normal version.

Best Practices

  • Use font-style to emphasize important words or phrases within a block of text.
  • Be careful not to use font-style too much, as it can make your text difficult to read.
  • Use font-style: italic for emphasis, rather than using ALL CAPS or bold text.
  • Only use font-style: oblique if the font you're using doesn't have an italic version, as it may not look as good.
  • Always test your website or application on multiple devices and browsers to ensure compatibility.

Browser Compatibility

ChromeFirefoxSafariInternet ExplorerMicrosoft EdgeOpera
YesYesYesYesYesYes