CSS/Properties/font-style

From Web Education Community Group
Jump to: navigation, search

font-style

The font-style property selects between normal, italic and oblique faces within a font family.

Description

Values normal | italic | oblique | inherit
Initial value normal
Applies to All elements
Inherited Yes


Values

  • normal


  • italic


  • oblique


  • inherit
    Takes the same specified value as the property for the element's parent.


Example

Example A

[style.css]

p#no{ font-style: normal; }
p#ita{ font-style: italic; }
p#obl{ font-style: oblique; }

[index.html]

<body>
  <p id="no">This is a paragraph(normal)</p>
  <p id="ita">This is a paragraph(italic)</p>
  <p id="obl">This is a paragraph(oblique)</p>
</body>

Csslist2 font-style.png

CSS Reference

The CSS specification defines the font-style property in 15.4 Font styling.