Little Web Hut

CSS 2.1 Reference: font-style Property

CSS font-style Property
Syntax
selector {font-style: value;}
  • value is specified by using one of the following keywords: normal, italic, oblique, or inherit.
Usage

The font-style property is used to specify a normal, italic, or oblique font style.

This property is specified by using a keyword according to the syntax shown above.


CSS Example: The font-style properties are set using all 3 font styles.
  #tst1 {font-style: normal;}
  #tst2 {font-style: italic;}
  #tst3 {font-style: oblique;}
Test It HTML StyleTest It XHTML StyleTest It HTML5 Style

Keywords
  • normal - This is a sample of a normal font style.
  • italic - This is a sample of an italic font style.
  • oblique - This is a sample of an oblique font style.
  • inherit - The inherit keyword is used to specify that the value for this property should be taken from the parent element. If inherit is used with the root element, then the initial value for this property will be used.
Applies To All elements
Inherited Yes
Initial Value normal


font-style Property Examples
Test It HTML StyleTest It HTML StyleTest It HTML5 StyleThe font-style properties are set using all 3 font styles.