CSS font-style Property

CSS font-style property sets the font style for text in HTML Element(s).

The syntax to specify a value for font-style property is

font-style: value;

The following table gives the possible values that could be set to font-style property.

ValueDescriptionExamples
normalA normal font style. [Default Value]font-style: normal;
italicItalic text style.font-style: italic;
obliqueOblique text style.font-style: oblique;
initialSets font-style to default value.font-style: initial;
inheritInherits font-style value from its parent element.font-style: inherit;

Examples

In the following examples, we set font style for the text using font-style property.

ADVERTISEMENT

Italic Font Style

In the following example, we set the style of text to italic, using font-style property.

Example

Oblique Font Style

In the following example, we set the style of text to italic, using font-style property.

Example

Conclusion

In this CSS Tutorial, we learned about font-style property, and how to use this property for HTML Elements, with examples.