Javatpoint Logo
Javatpoint Logo

CSS font-style property

CSS font-style property defines what type of font you want to display. It may be italic, oblique, or normal. This CSS property is used to define the style of font for the text content of an element.

Syntax

Property Values

The property values of this CSS property are tabulated as follows:

Keyword Description
normal This is the default value. Using this value, the browser will display the normal font text.
italic This property value of the font-style property is used to make the font italic. Italic fonts are the cursive versions of the font.
oblique This property value of the font-style property is used to make the font oblique. Oblique fonts are the sloped versions of the font.
initial Using this value, the browser will display the initial font style that is the default. Basically, this value sets the property to its default value.
inherit It inherits the property from its parent element.

If the given font-family has an embedded oblique or italic font face, the browser will select that face. If there is no oblique or italic face is available, the browser will mimic the sloping effect. If we define the italic value, and there is no italic face is available, the browser will check the oblique face before trying to mimic the italic.

The same process will apply to the oblique as if there is no oblique face is available, the browser first checks for italic face before trying to mimic the oblique.

To prevent a browser from adding a mimicked version of the oblique or italic face, we can use the font-synthesis property if it is supported.

Let's understand the above property values by using an example.

Example

In this example, we are using all the values of the font-style property.

Output:

CSS font-style property
Next TopicCSS Box Sizing





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA