Set the font for a <p> element to "italic":
The fontStyle property sets or returns whether the style of the font is normal, italic or oblique.
The fontStyle property is supported in all major browsers.
Return the fontStyle property:
Set the fontStyle property:
Value | Description |
---|---|
normal | Font is normal. This is default |
italic | Font is in italic |
oblique | Font is in oblique |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Default Value: | normal |
---|---|
Return Value: | A String, representing the font style of the text in the element |
CSS Version | CSS1 |
A demonstration of possible values:
Return the font style of a <p> element:
CSS tutorial: CSS Font
CSS reference: font-style property
HTML DOM reference: font property