What is font-style property in CSS?
The font-style property in CSS is used to alter the font of a segment of text.
Syntax
The syntax of the font-style property is as follows:
font-style: normal|italic|oblique|initial|inherit;
Possible fonts
There can be five different types of fonts:
-
normal: Refers to a normal default browser font.
-
italic: Refers to an italic browser font.
-
oblique: Refers to an oblique browser font.
-
initial: Sets the font to an element’s default font.
-
inherit: Inherits a font from its parent element.
Example
The code snippet below shows each type of font-style in CSS:
Free Resources
Copyright ©2025 Educative, Inc. All rights reserved