The font-style
CSS property specifies whether a font should be styled with a normal, italic, or oblique face from its font-family
.
font-style: normal; font-style: italic; font-style: oblique; /* Global values */ font-style: inherit; font-style: initial; font-style: unset;
Italic font faces are generally cursive in nature, usually using less horizontal space than their unstyled counterparts, while oblique faces are usually just sloped versions of the regular face. When the specified style is not available, both italic and oblique faces are simulated by artificially sloping the glyphs of the regular face (use font-synthesis
to control this behavior).
Initial value | normal |
---|---|
Applies to | all elements. It also applies to ::first-letter and ::first-line . |
Inherited | yes |
Media | visual |
Computed value | as specified |
Animation type | discrete |
Canonical order | the unique non-ambiguous order defined by the formal grammar |
Syntax
The font-style
property is specified as a single keyword chosen from the list of values below.
Values
normal
- Selects a font that is classified as
normal
within afont-family
. italic
- Selects a font that is classified as
italic
. If no italic version of the face is available, one classified asoblique
is used instead. If neither is available, the style is artificially simulated. oblique
- Selects a font that is classified as
oblique
. If no oblique version of the face is available, one classified asitalic
is used instead. If neither is available, the style is artificially simulated.
Formal syntax
normal | italic | oblique
Examples
Font styles
<p class="normal">This paragraph is normal.</p> <p class="italic">This paragraph is italic.</p> <p class="oblique">This paragraph is oblique.</p>
.normal { font-style: normal; } .italic { font-style: italic; } .oblique { font-style: oblique; }
Specifications
Specification | Status | Comment |
---|---|---|
CSS Fonts Module Level 3 The definition of 'font-style' in that specification. |
Candidate Recommendation | No change |
CSS Level 2 (Revision 1) The definition of 'font-style' in that specification. |
Recommendation | No change |
CSS Level 1 The definition of 'font-style' in that specification. |
Recommendation | Initial definition |
Browser compatibility
Feature | Chrome | Edge | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|---|
Basic support | 1.0 | (Yes) | 1.0 (1.7 or earlier) [1] | 4.0 | 7.0 | 1.0 |
Feature | Android | Edge | Firefox Mobile (Gecko) | IE Phone | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|
Basic support | 1.0 | (Yes) | 1.0 (1) [1] | 6.0 | 6.0 | 1.0 |
[1] Before Firefox 44, Gecko didn't distinguish oblique
from italic
. Since then, it uses the correct face, if available.
Document Tags and Contributors
Tags:
Contributors to this page:
mfluehr,
wbamberg,
erikadoyle,
Jdaggett,
teoli,
fscholz,
Sheppy,
Sebastianz,
churanta,
nagashayan,
zachbruggeman,
xkizer,
kscarfone,
vim-chhetri,
FredB,
ethertank,
mamasboy714@yahoo.com
Last updated by:
mfluehr,