MDN’s new design is in Beta! A sneak peek: https://blog.mozilla.org/opendesign/mdns-new-design-beta/

Unsere Freiwilligen haben diesen Artikel noch nicht in Deutsch übersetzt. Machen Sie mit und helfen Sie, das zu erledigen!
Sie können den Artikel auch auf English (US) lesen.

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 valuenormal
Applies toall elements. It also applies to ::first-letter and ::first-line.
Inheritedyes
Mediavisual
Computed valueas specified
Animation typediscrete
Canonical orderthe 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 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.

Formal syntax

normal | italic | oblique

Examples

Font styles

.normal {
  font-style: normal;
}

.italic {
  font-style: italic;
}

.oblique {
  font-style: oblique;
}

Specific​ations

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.

Schlagwörter des Dokuments und Mitwirkende

 Zuletzt aktualisiert von: mfluehr,