CSS font-style Property

CSS font-style property specifies the style of the font such as italic, oblique or normal.

Usages

The following table outline the usages and version history of this property.

Default value: normal
Applies to: All elements
Inherited: Yes
Version: CSS1
JavaScript Syntax: object.style.fontStyle = "italic"

Syntax

Here is a syntax for the CSS font-style property

font-style: normal | italic | oblique | initial | inherit;

Property Values

The following table describes the values of this property.

Value Description
normal default. Browser displays as normal font style
italic Browser displays as italic font style
oblique Browser displays as oblique font style
initial Sets default value of this property
inherit Inherits this property from its parent element

Examples

The example below shows to sets font style normal, italic, oblique values.

p.one {
  font-style: normal;
}
p.two {
  font-style: italic;
}
p.three {
  font-style: oblique;
}

Run it...   »

Browser Compatibility

  • Google Chrome 1+
  • Mozilla Firefox 1+
  • Internet Explorer 4+
  • Opera 7+
  • Safari 1+

Note: Here details of browser compatibility with version number may be this is bug and not supported. But recommended to always use latest Web browser.