Encodera

Thanks for reading!

Donate to the site — we work hard for you.

HTML & CSS reference

font-style

Italic or normal text.

Syntax

font-style: italic;

Values

ParameterTypeDescription
normalkeywordUpright text.
italickeywordItalic text.

Examples

An italic quote; the emphasized word inside it is upright:

<style>
  .quote { font-style: italic; }
  .quote em { font-style: normal; font-weight: bold; }
</style>
 
<p class="quote">"Simple things should be <em>simple</em>."</p>

Notes

<em> and <i> are italic by default; font-style: normal cancels that. If the font has no italic version, the browser slants the regular letters.

See also

  • font — A shorthand that sets the style, weight, size, line height and family of the font in one line.
  • font-weight — The weight (boldness) of the font.
  • text-decoration — Lines on text: underline, strikethrough, overline.

Related recipes

In the tutorial

  • Text and fonts — Font family, size, weight, italics, line height, alignment and text decoration, plus loading your own font.

Thanks for reading!

Donate to the site — we work hard for you.