CSS font-style
Property
Topic: CSS3 Properties ReferencePrev|Next
Description
This font-style
CSS property defines the style of font for the element's text content.
The following table summarizes the usages context and the version history of this property.
Default value: | normal |
---|---|
Applies to: | All elements |
Inherited: | Yes |
Animatable: | No. See animatable properties. |
Version: | CSS 1, 2, 3 |
Syntax
The syntax of the property is given with:
The example below shows the font-style
property in action.
Example
Try this code »p {
font-style: italic;
}
Property Values
The following table describes the values of this property.
Value | Description |
---|---|
normal |
Selects a font that is classified as normal in the user agent's font database. |
italic |
Selects a font that is labeled italic in the user agent's font database, if that is not available, it will use one labeled oblique. |
oblique |
Selects a font that is labeled oblique in the user agent's font database. |
inherit |
If specified, the associated element takes the computed value of its parent element font-style property. |
Note: If no italic or oblique faces are available, an oblique face can be synthesized by rendering the normal face with a slanting transformation applied to them.
Browser Compatibility
The font-style
property is supported in all major modern browsers.
Basic Support—
|
Further Reading
See tutorial on: CSS Fonts, CSS Text.
Related properties and at-rules: font
, font-variant
, font-weight
, font-size
, line-height
, font-family
, @font-face
.