CSS font-style Property
The font-style property specifies whether text uses a normal, italic, or oblique font style.
Italic and oblique styles both produce slanted text, but they are not necessarily the same. An italic font may contain specially designed letterforms, while an oblique font generally uses slanted versions of upright letterforms. The property can also specify an oblique angle when supported by the selected font and browser.
font-style Syntax
The font-style property accepts the keywords normal, italic, and oblique. The oblique keyword may also be followed by an angle.
Basic Syntax
selector {
font-style: italic;
}
Normal Style
selector {
font-style: normal;
}
Oblique Style
selector {
font-style: oblique;
}
Oblique Angle
selector {
font-style: oblique 15deg;
}
Negative Oblique Angle
selector {
font-style: oblique -10deg;
}
CSS-Wide Keywords
.example {
font-style: inherit;
}
.example {
font-style: initial;
}
.example {
font-style: unset;
}
.example {
font-style: revert;
}
.example {
font-style: revert-layer;
}
Oblique angles are limited to the range from -90deg through 90deg. The actual appearance depends on the available font styles and the browser's font matching behavior.
Property Values
The property provides three main font styles and supports an optional angle for oblique text.
| Value | Description |
|---|---|
normal |
Requests the normal, upright font style. |
italic |
Requests an italic font face, which may contain specially designed letterforms. |
oblique |
Requests an oblique font style, typically using slanted upright letterforms. |
oblique <angle> |
Requests an oblique style at a specified angle. |
Property Characteristics
| Characteristic | Value |
|---|---|
| Initial value | normal |
| Inherited | Yes |
| Applies to | All elements and text |
| Computed value | The specified keyword, with an angle where applicable |
| Animation type | By computed value type |
| Percentages | Not applicable |
The font-style property is also included in the font shorthand. When the shorthand is used, it can reset the previously specified font style.
How It Works
The font-style property participates in font selection. The browser uses the requested style together with the font family, weight, and width to choose an appropriate font face.
Selecting a Font Face
.heading {
font-family: Georgia, serif;
font-style: italic;
}
The browser attempts to select an italic face from the Georgia font family.
Available Font Styles
A font family may provide separate normal, italic, and oblique faces. Other families may provide only upright designs.
Missing Font Styles
When a requested style is unavailable, the browser follows font matching rules. It may select another available face or synthesize a slanted appearance when permitted.
Variable Font Support
Some variable fonts provide italic or slant axes, allowing the browser to select styles from a range of supported designs.
Important Consideration
Setting font-style: italic does not guarantee that a font family contains a dedicated italic face. The final appearance depends on the font and the browser's handling of unavailable styles.
The normal Value
The normal value requests the upright font style and is the property's initial value.
Basic Example
p {
font-style: normal;
}
Reset Italic Text
.italic-container {
font-style: italic;
}
.italic-container .normal-text {
font-style: normal;
}
Override Default Emphasis Styling
em {
font-style: normal;
font-weight: 700;
}
Browsers commonly display the <em> element in italics by default. This example changes its visual appearance while preserving its semantic meaning.
Important Consideration
The normal value selects an upright font style. It does not reset font weight, font size, or other typography properties.
The italic Value
The italic value requests an italic font face. A true italic design may include letterforms that differ from the upright font rather than simply being slanted.
Basic Example
.emphasis {
font-style: italic;
}
Italic Heading
h2 {
font-family: Georgia, serif;
font-style: italic;
}
Italic Paragraph
.introduction {
font-style: italic;
}
Combining Italic and Bold
.featured-heading {
font-style: italic;
font-weight: 700;
}
Italic Text with HTML
<p>This paragraph contains <em>emphasized text</em>.</p>
The <em> element conveys emphasis, while font-style: italic controls visual presentation. Use semantic HTML when the text has a meaningful purpose beyond appearance.
Important Consideration
Italic fonts can have different character widths and spacing from their upright counterparts. Switching between styles may change line wrapping.
The oblique Value
The oblique value requests a slanted font style. Unlike a true italic design, an oblique face generally retains the basic letterforms of the upright font.
Basic Example
.slanted-text {
font-style: oblique;
}
Oblique Heading
h2 {
font-family: Arial, sans-serif;
font-style: oblique;
}
Oblique with Font Weight
.heading {
font-style: oblique;
font-weight: 600;
}
Oblique vs. Italic
.italic-text {
font-style: italic;
}
.oblique-text {
font-style: oblique;
}
The two styles may look similar when the font does not provide separate italic and oblique designs.
Important Consideration
When an oblique face is unavailable, browsers may use an italic face or synthesize an oblique appearance according to font matching and synthesis rules.
Oblique Angles
The oblique keyword can be followed by an angle to request a specific slant.
Positive Angle
.slanted-heading {
font-style: oblique 15deg;
}
Negative Angle
.reverse-slant {
font-style: oblique -10deg;
}
Different Angles
.slant-small {
font-style: oblique 5deg;
}
.slant-medium {
font-style: oblique 12deg;
}
.slant-large {
font-style: oblique 20deg;
}
Angle Range
Valid oblique angles range from -90deg to 90deg. Values outside this range are invalid.
Default Oblique Angle
When no angle is specified, the browser requests a conventional oblique style. For synthesized oblique text, the CSS specification defines a default slant of 14deg.
Font Support
A font with a variable slant axis may support a range of oblique angles. A font with only one oblique face may not produce a different appearance for every requested angle.
Important Consideration
The angle is a font style selection value, not a general element rotation. Use transform: rotate() when the intention is to rotate an entire element.
Italic vs. Oblique
Italic and oblique fonts can both appear slanted, but their underlying designs may differ.
Italic Design
A true italic font may use specially drawn letterforms, altered proportions, and different spacing to create a distinct typographic style.
Oblique Design
An oblique font generally uses slanted versions of upright letterforms, although professionally designed oblique faces may include optical adjustments.
Comparison
| Feature | italic | oblique |
|---|---|---|
| Appearance | Typically slanted | Typically slanted |
| Letterforms | May use specially designed italic shapes | Generally based on upright shapes |
| Angle control | No angle argument | Supports an optional angle |
| Font availability | Requires a suitable italic face for a true italic design | Uses an available oblique face or permitted synthesis |
Example
.italic-example {
font-style: italic;
}
.oblique-example {
font-style: oblique;
}
Important Consideration
Some fonts and browsers produce nearly identical results for italic and oblique. The distinction is most apparent when the font family provides dedicated designs for both styles.
Font Matching and Fallbacks
The browser uses font matching rules to choose a suitable face when the requested style is not available.
Preferred Italic Face
.heading {
font-family: "Example Sans", Arial, sans-serif;
font-style: italic;
}
The browser searches for an appropriate italic face in the selected font family.
Missing Italic Face
If the family does not provide an italic face, the browser may use an available oblique face or synthesize a slanted version of an upright face.
Missing Oblique Face
.heading {
font-family: "Example Sans", Arial, sans-serif;
font-style: oblique;
}
The browser attempts to find a suitable oblique face and may use another style or synthesis when an exact match is unavailable.
Fallback Font Families
When the preferred font family cannot display a character or is unavailable, a fallback font may be used. The fallback's italic or oblique appearance can differ from the preferred font.
Important Consideration
Font matching and font synthesis are separate processes. Matching selects an available font face, while synthesis can create a simulated style when permitted.
Variable Fonts
Variable fonts may provide axes that control italic or oblique styles without requiring a separate static font file for every variation.
Italic Axis
The registered ital axis identifies italic styling in compatible variable fonts.
.italic-heading {
font-family: "Example Variable Sans", sans-serif;
font-style: italic;
}
Slant Axis
The registered slnt axis controls oblique slant in compatible variable fonts.
.oblique-heading {
font-family: "Example Variable Sans", sans-serif;
font-style: oblique 12deg;
}
Direct Axis Control
.custom-slant {
font-family: "Example Variable Sans", sans-serif;
font-variation-settings: "slnt" -12;
}
Direct axis values use the font's axis conventions. The registered slnt axis commonly uses negative values for a forward slant, while CSS font-style: oblique uses positive angles for that direction.
Preferred Approach
Use font-style for ordinary italic and oblique selection. Use font-variation-settings when direct control over a font's variation axes is specifically required.
Important Consideration
The variable font must provide the relevant axis and supported range. A requested angle does not create a new variable axis in a font that lacks one.
Using @font-face
The font-style descriptor inside @font-face identifies the style supplied by a font resource.
Normal Font Face
@font-face {
font-family: "Example Sans";
src: url("example-sans-regular.woff2") format("woff2");
font-style: normal;
font-weight: 400;
}
Italic Font Face
@font-face {
font-family: "Example Sans";
src: url("example-sans-italic.woff2") format("woff2");
font-style: italic;
font-weight: 400;
}
Selecting the Italic Face
.heading {
font-family: "Example Sans", sans-serif;
font-style: italic;
}
Variable Oblique Font
@font-face {
font-family: "Example Variable Sans";
src: url("example-variable-sans.woff2") format("woff2");
font-style: oblique -10deg 20deg;
font-weight: 100 900;
}
The angle range declares the oblique styles supported by the font resource.
Using the Variable Font
.heading {
font-family: "Example Variable Sans", sans-serif;
font-style: oblique 15deg;
}
Important Consideration
The font-style descriptor describes the font resource. It does not create an italic or oblique design that the font file does not contain.
Synthetic Font Styles
When a font lacks an italic or oblique face, browsers may synthesize a slanted appearance from an upright font.
Allowing Synthesis
.heading {
font-family: "Example Sans", sans-serif;
font-style: italic;
font-synthesis-style: auto;
}
Disabling Style Synthesis
.heading {
font-family: "Example Sans", sans-serif;
font-style: italic;
font-synthesis-style: none;
}
When synthesis is disabled and no suitable italic or oblique face exists, the browser uses an available font face without generating a simulated slant.
Using the font-synthesis Shorthand
.heading {
font-synthesis: none;
}
The font-synthesis shorthand controls several kinds of synthetic font styling, including weight and style synthesis.
Why Synthesis Matters
A synthesized slant may not have the carefully designed letterforms or spacing of a true italic font. This difference can be noticeable in headings and decorative typography.
Important Consideration
Disabling synthesis does not guarantee that text will appear upright. The browser may still select a genuine italic or oblique face when one is available.
Inheritance
The font-style property is inherited. Child elements use the parent's computed font style unless they specify another value.
Inherited Italic Style
.container {
font-style: italic;
}
<div class="container">
<p>This paragraph inherits the italic style.</p>
</div>
Override a Child Element
.container {
font-style: italic;
}
.container .normal-text {
font-style: normal;
}
Explicit Inheritance
.child {
font-style: inherit;
}
Reset to the Initial Value
.child {
font-style: initial;
}
The initial value is normal.
Important Consideration
Some HTML elements, including <em> and <i>, commonly receive italic styling from the browser's default stylesheet. Those styles can override an inherited normal style unless explicitly changed.
font-style Example
This example compares normal, italic, and oblique text using the Georgia font family. It also demonstrates an explicit oblique angle.
The appearance of italic and oblique text depends on the font faces available in the browser. Some examples may look similar because the browser can use matching or synthesized styles.
HTML Example
<div class="font-style-demo">
<p class="demo-label">Normal font style</p>
<p class="style-normal">Creative Typography</p>
<p class="demo-label">Italic font style</p>
<p class="style-italic">Creative Typography</p>
<p class="demo-label">Oblique font style</p>
<p class="style-oblique">Creative Typography</p>
<p class="demo-label">Oblique 20deg</p>
<p class="style-oblique-angle">Creative Typography</p>
</div>
CSS Example
.font-style-demo {
font-family: Georgia, serif;
}
.font-style-demo p {
margin: 0 0 14px;
}
.font-style-demo .demo-label {
font: 600 13px/1.4 Arial, sans-serif;
}
.font-style-demo .style-normal,
.font-style-demo .style-italic,
.font-style-demo .style-oblique,
.font-style-demo .style-oblique-angle {
font-size: 28px;
line-height: 1.4;
}
.style-normal {
font-style: normal;
}
.style-italic {
font-style: italic;
}
.style-oblique {
font-style: oblique;
}
.style-oblique-angle {
font-style: oblique 20deg;
}
Normal font style
Creative Typography
Italic font style
Creative Typography
Oblique font style
Creative Typography
Oblique 20deg
Creative Typography
The normal example uses upright letterforms. The italic example requests a dedicated italic design, while the oblique examples request slanted text.
The 20deg example requests a stronger oblique angle. If the selected font does not support that angle, the browser may use a nearby available style or synthesize the requested slant.
Common Mistakes
Most problems with font-style involve confusing italic and oblique styles or expecting a font to support styles it does not contain.
Using bold as a font-style Value
p {
font-style: bold;
}
This declaration is invalid. Use font-weight: bold to request bold text.
Using a Percentage
p {
font-style: 50%;
}
Percentages are not valid values for font-style.
Using an Angle Without oblique
p {
font-style: 15deg;
}
An angle must follow the oblique keyword.
Using an Angle with italic
p {
font-style: italic 15deg;
}
The italic keyword does not accept an angle argument.
Using an Angle Outside the Valid Range
p {
font-style: oblique 120deg;
}
Oblique angles must be between -90deg and 90deg.
Assuming italic and oblique Are Identical
A true italic font may contain specially designed letterforms, while oblique styles generally use slanted upright designs.
Expecting Every Font to Include Italics
Some font families contain only upright faces. The browser may need to select another style or synthesize a slant.
Confusing Oblique Angles with Rotation
The font-style property selects a slanted font style. It does not rotate the element or its layout box.
Forgetting That font Resets font-style
.heading {
font-style: italic;
font: 24px Arial, sans-serif;
}
The font shorthand resets the style to normal unless an italic or oblique style is included in the shorthand declaration.
Important Considerations
Keep the following points in mind when using the font-style property:
- Purpose: Selects normal, italic, or oblique font styles.
- Initial value:
normal. - Inheritance: The property is inherited.
- Applies to: All elements and text.
- normal: Requests upright font styling.
- italic: Requests an italic font face.
- oblique: Requests an oblique font style.
- Oblique angles: May be specified after the
obliquekeyword. - Valid angle range:
-90degthrough90deg. - Italic designs: May contain specially drawn letterforms.
- Oblique designs: Generally use slanted upright letterforms.
- Font availability: The requested style may not exist in the selected font family.
- Font matching: Browsers select an available face according to CSS matching rules.
- Synthesis: Browsers may create simulated slanted text when permitted.
- Variable fonts: Compatible fonts may provide italic and slant axes.
- @font-face: The
font-styledescriptor identifies the styles supplied by a font resource. - font-synthesis-style: Controls whether synthetic italic or oblique styling is permitted.
- font shorthand: Can set or reset the font style.
- Semantic HTML: Use
<em>for meaningful emphasis rather than relying only on visual italics. - Layout: Different font styles may have different character widths and spacing.
- Browser support: Modern browsers support the property, although available font styles affect the result.
Use font-style: italic for conventional italic typography and font-style: oblique when an oblique design or specific slant angle is appropriate. For the best results, use fonts that provide the intended styles rather than relying on synthetic rendering.
Browser Support
The CSS font-style property is Widely available in modern browsers, including Chrome, Edge, Firefox, and Safari.
The normal, italic, and oblique keywords have long-standing support. Explicit oblique angles are supported in current browsers, although older browser versions may not recognize the extended syntax.
Basic Supported Example
p {
font-style: italic;
}
Oblique Angle Example
p {
font-style: oblique 15deg;
}
Fallback Example
p {
font-style: oblique;
font-style: oblique 15deg;
}
Browsers that do not recognize the angle syntax can retain the earlier oblique declaration.
Feature Detection
@supports (font-style: oblique 15deg) {
.heading {
font-style: oblique 15deg;
}
}
For current compatibility information, visit Can I Use? and search for font-style.
Specifications
The font-style property is defined in the CSS Fonts Module, which describes font style selection, oblique angles, and font matching behavior.
CSS Fonts Module Level 4: font-style Property
The CSS Fonts Module also defines the @font-face descriptors used to identify available font styles.
CSS Fonts Module Level 4: @font-face Rule
For additional explanations and examples, see MDN Web Docs.
