Thefont-style
CSS property specifies whether a font should be styled with a normal, italic, or oblique face from its font-family
.
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).
font-style: normal; font-style: italic; font-style: oblique; /* Global values */ font-style: inherit; font-style: initial; font-style: unset;
The font-style
property is specified as a single keyword chosen from the list of values below.
normal
normal
within a font-family
.italic
italic
. If no italic version of the face is available, one classified as oblique
is used instead. If neither is available, the style is artificially simulated.oblique
oblique
. If no oblique version of the face is available, one classified as italic
is used instead. If neither is available, the style is artificially simulated.normal | italic | oblique
.normal { font-style: normal; } .italic { font-style: italic; } .oblique { font-style: oblique; }
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 |
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 |
Feature | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|---|
Basic support | 1 | 12 | 11 | 4 | 7 | 1 |
Feature | Android webview | Chrome for Android | Edge mobile | Firefox for Android | Opera Android | iOS Safari | Samsung Internet |
---|---|---|---|---|---|---|---|
Basic support | 1 | 1 | 12 | 41 | 6 | 1 | ? |
1. Before Firefox 44, oblique
was not distinguished from italic
.
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/CSS/font-style