CSSfont-style Property
Example
Set different font styles for three paragraphs:
p.a {
font-style: normal;
}
p.b {
font-style: italic;
}
p.c {
font-style: oblique;
}
Try it Yourself »font-style: normal;
}
p.b {
font-style: italic;
}
p.c {
font-style: oblique;
}
Definition and Usage
Thefont-style property specifies the font style for a text.
| Default value: | normal |
|---|---|
| Inherited: | yes |
| Animatable: | no.Read aboutanimatable |
| Version: | CSS1 |
| JavaScript syntax: | object.style.fontStyle="italic"Try it |
Browser Support
The numbers in the table specify the first browser version that fully supports the property.
| Property | |||||
|---|---|---|---|---|---|
| font-style | 1.0 | 4.0 | 1.0 | 1.0 | 7.0 |
CSS Syntax
font-style: normal|italic|oblique|initial|inherit;
Property Values
| Value | Description | Demo |
|---|---|---|
| normal | The browser displays a normal font style. This is default | Demo ❯ |
| italic | The browser displays an italic font style | Demo ❯ |
| oblique | The browser displays an oblique font style | Demo ❯ |
| initial | Sets this property to its default value.Read aboutinitial | |
| inherit | Inherits this property from its parent element.Read aboutinherit |
Related Pages
CSS tutorial:CSS Font
CSS reference:font property
HTML DOM reference:fontStyle property

