Please note, this is a STATIC archive of website developer.mozilla.org from November 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

font-style

Our volunteers haven't translated this article into Türkçe yet. Join us and help get the job done!

Summary

The font-style CSS descriptor allows authors to specify font styles for the fonts specified in the @font-face rule.

For a particular font family, authors can download various font faces which correspond to the different styles of the same font family, and then use the font-style descriptor to explicitly specify the font face's style. The values for the CSS descriptor is same as that of its corresponding font property.

Related at-rule@font-face
Initial valuenormal
Mediaall
Computed valueas specified
Canonical orderthe unique non-ambiguous order defined by the formal grammar

Syntax

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

Values

normal
Selects the normal version of the font-family.

italic
Specifies that font-face is an italicized version of the normal font .

oblique
Specifies that the font-face is an artificially sloped version of the normal font.

Formal syntax

normal | italic | oblique

Examples

As an example, consider the garamond font family, in its normal form, we get the following result:

@font-face {
  font-family: garamond;
  src: url('garamond.ttf');
}

unstyled Garamond

The italicized version of this text uses the same glyphs present in the unstyled version, but they are artificially sloped by a few degrees.

artificially sloped garamond

On the other hand, if a true italicized version of the font family exists, we can include it in the src descriptor and specify the font style as italic, so that it is clear that the font is italicized. True italics use different glyphs and are a bit different from their upright counterparts, having some unique features and generally have a rounded and calligraphic quality. These fonts are specially created by font designers and are not artificially sloped.

@font-face {
  font-family: garamond;
  src: url('garamond-italic.ttf');
  font-style: italic;
}

italic garamond

Specifications

Specification Status Comment
CSS Fonts Module Level 3
The definition of 'unicode-range' in that specification.
Candidate Recommendation Initial definition

Browser compatibility

Feature Firefox (Gecko) Chrome Internet Explorer Opera Safari
Basic support 3.5 (1.9.1) 4.0   4.0 10.0 3.1
Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mini Opera Mobile Safari Mobile
Basic support (Yes) 1.0 (1.9.1) ? Not supported 10.0 (Yes)

Document Tags and Contributors

 Contributors to this page: cynicaldevil, teoli
 Last updated by: cynicaldevil,