CSS font-style property
CSS font-style property
Description
The font-style property determines one of three fonts used in text rendering for a given element.
Possible values
- normal − Specifies the normal font; that is, the default font used.
-
italic − Specifies an italic font; that is, a font that is tilted and has characters modified to improve readability in an oblique state.
-
oblique − Specifies an oblique font; that is, a tilted font.
Applies to
All HTML elements
DOM Syntax
object.style.fontStyle = "italic";
Example
Here is an example of using this property −
<html>
<head>
</head>
<body>
<p style = "font-style:italic;">
This text will be rendered in italic style
</p>
</body>
</html>
This will produce the following result −