Spec-Zone.ru › CSS

`font-style` CSS property

Baseline Widely available

This feature is well established and works across many devices and browser versions. It's been available across browsers since July 2015.

The font-style CSS property sets 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).

Try it

font-style: normal;
font-style: italic;
font-style: oblique;
font-style: oblique 40deg;
<section id="default-example">
  <p id="example-element">
    London. Michaelmas term lately over, and the Lord Chancellor sitting in
    Lincoln's Inn Hall. Implacable November weather. As much mud in the streets
    as if the waters had but newly retired from the face of the earth, and it
    would not be wonderful to meet a Megalosaurus, forty feet long or so,
    waddling like an elephantine lizard up Holborn Hill.
  </p>
</section>
@font-face {
  src: url("/shared-assets/fonts/variable-fonts/AmstelvarAlpha-VF.woff2");
  font-family: "Amstelvar";
  font-style: normal;
}

section {
  font-size: 1.2em;
  font-family: "Amstelvar", serif;
}

Syntax

font-style: normal;
font-style: italic;
font-style: oblique;
font-style: oblique 10deg;

/* Global values */
font-style: inherit;
font-style: initial;
font-style: revert;
font-style: revert-layer;
font-style: unset;

Values

This property is specified as one of the following keyword values. The oblique keyword can optionally be followed by an <angle>:

normal
Selects a font that is classified as normal within a font-family.
italic
Selects a font that is classified as 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
Selects a font that is classified as 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.
oblique <angle>

Selects a font classified as oblique, and additionally specifies an angle for the slant of the text. If one or more oblique faces are available in the chosen font family, the one that most closely matches the specified angle is chosen. If no oblique faces are available, the browser will synthesize an oblique version of the font by slanting a normal face by the specified amount. Valid values are degree values of -90deg to 90deg inclusive. If an angle is not specified, an angle of 14 degrees is used. Positive values are slanted to the end of the line, while negative values are slanted towards the beginning.

In general, for a requested angle of 14 degrees or greater, larger angles are preferred; otherwise, smaller angles are preferred (see the spec's font matching section for the precise algorithm).

The CSS fonts module also defines left and right values to select an italic or oblique face with a specific slant direction; however, these values are not supported in any browsers.

Variable fonts

Variable fonts can offer a fine control over the degree to which an oblique face is slanted. You can select this using the <angle> modifier for the oblique keyword.

For TrueType or OpenType variable fonts, the "slnt" variation is used to implement varying slant angles for oblique, and the "ital" variation with a value of 1 is used to implement italic values. See font-variation-settings.

Click "Play" in the code blocks below to edit the example in the MDN Playground. Change the angle value to see the slant of the text change.

<p class="sample">
  ...it would not be wonderful to meet a Megalosaurus, forty feet long or so,
  waddling like an elephantine lizard up Holborn Hill.
</p>
@font-face {
  src: url("https://mdn.github.io/shared-assets/fonts/variable-fonts/AmstelvarAlpha-VF.woff2");
  font-family: "AmstelvarAlpha";
  font-style: normal;
}

.sample {
  font:
    2rem "AmstelvarAlpha",
    sans-serif;
  /* font-variation-settings: "slnt" 12; */
  font-style: oblique 23deg;
}

Accessibility

Large sections of text set with a font-style value of italic may be difficult for people with cognitive concerns such as Dyslexia to read.

  • MDN Understanding WCAG, Guideline 1.4 explanations
  • W3C Understanding WCAG 2.2

Formal definition

Initial value normal
Applies to all elements and text
Inherited yes
Computed value as specified
Animation type by computed value type; <code>normal</code> animates as <code>oblique 0deg</code>

Formal syntax

font-style = 
  normal |
  italic |
  oblique <angle>?

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
CSS Fonts Module Level 4
# font-style-prop

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on iOS Samsung Internet WebView Android WebView on iOS
font-style
1
12
1Before Firefox 44, oblique was not distinguished from italic.
7
1
18
4Before Firefox for Android 44, oblique was not distinguished from italic.
10.1
1
1.0
4.4
1
italic
1
12
1
15
1
18
4
14
1
1.0
4.4
1
normal
1
12
1
15
1
18
4
14
1
1.0
4.4
1
oblique
1
12
1
15
1
18
4
14
1
1.0
4.4
1
oblique-angle
62Angles from 14 to 90 have the same effect as font-style: oblique (with a slant of 14 degrees). Angles from -90 to 13 have the same effect as font-style: normal (without a slant). In some cases (e.g. with vertical writing-mode), a negative angle produces a slant. See bug 425388876.
79Angles from 14 to 90 have the same effect as font-style: oblique (with a slant of 14 degrees). Angles from -90 to 13 have the same effect as font-style: normal (without a slant). In some cases (e.g. with vertical writing-mode), a negative angle produces a slant. See bug 425388876.
61
49Angles from 14 to 90 have the same effect as font-style: oblique (with a slant of 14 degrees). Angles from -90 to 13 have the same effect as font-style: normal (without a slant). In some cases (e.g. with vertical writing-mode), a negative angle produces a slant. See bug 425388876.
11.1Angles from 14 to 90 have the same effect as font-style: oblique (with a slant of 14 degrees). Angles from -90 to 13 have the same effect as font-style: normal (without a slant). In some cases (e.g. with vertical writing-mode), a negative angle produces a slant. See bug 425388876.
62Angles from 14 to 90 have the same effect as font-style: oblique (with a slant of 14 degrees). Angles from -90 to 13 have the same effect as font-style: normal (without a slant). In some cases (e.g. with vertical writing-mode), a negative angle produces a slant. See bug 425388876.
61
46Angles from 14 to 90 have the same effect as font-style: oblique (with a slant of 14 degrees). Angles from -90 to 13 have the same effect as font-style: normal (without a slant). In some cases (e.g. with vertical writing-mode), a negative angle produces a slant. See bug 425388876.
11.3Angles from 14 to 90 have the same effect as font-style: oblique (with a slant of 14 degrees). Angles from -90 to 13 have the same effect as font-style: normal (without a slant). In some cases (e.g. with vertical writing-mode), a negative angle produces a slant. See bug 425388876.
8.0Angles from 14 to 90 have the same effect as font-style: oblique (with a slant of 14 degrees). Angles from -90 to 13 have the same effect as font-style: normal (without a slant). In some cases (e.g. with vertical writing-mode), a negative angle produces a slant. See bug 425388876.
62Angles from 14 to 90 have the same effect as font-style: oblique (with a slant of 14 degrees). Angles from -90 to 13 have the same effect as font-style: normal (without a slant). In some cases (e.g. with vertical writing-mode), a negative angle produces a slant. See bug 425388876.
11.3Angles from 14 to 90 have the same effect as font-style: oblique (with a slant of 14 degrees). Angles from -90 to 13 have the same effect as font-style: normal (without a slant). In some cases (e.g. with vertical writing-mode), a negative angle produces a slant. See bug 425388876.

See also

  • font-family
  • font-weight
  • SVG font-style attribute
  • Learn: Fundamental text and font styling

© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/font-style

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API