CSS font-style
property is used to italicize the text. It basically specifies how much slant or sloped a text should appear.
The example below sets different font-style for each paragraph:
Example:
.p1{ font-style: normal; } .p2{ font-style: italic; } .p3{ font-style: oblique; }
CSS Syntax
The font-style
property has the following syntax:
font-style: normal|italic|oblique|initial|inherit;
Property Values
The font-style
property accepts the following values:
normal | This is the default value. The text is displayed normally. |
italic | The text is slightly slanted. |
oblique | The text is more slanted than italic. |
initial | Sets the font-style property to its default value(normal). |
inherit | Inherits the font-style property from the parent element. |
General Info
Default Value | normal |
Inherited | Yes |
JavaScript Usage | element.style.fontStyle = “italic”; |