font-style property
Sets or retrieves the font style of the object as italic, normal, or oblique.
Syntax
font-style: normal | italic | oblique
Property values
normal-
Initial value. Font is normal.
italic-
Font is italic.
oblique-
Font is italic.
CSS information
| Applies To | All elements |
|---|---|
| Media | visual |
| Inherited | true |
| Initial Value | normal |
Remarks
Windows Internet Explorer is shipped with a default font-style, but you can change this default in Internet Options.
Examples
The following example shows how to use hn as a selector to set the font style to italic in h3 headings.
Code example: http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/font-style.htm
<style type="text/css">
h3 { font-style:italic }
</style>
The following example shows how to use inline scripting to set the font style to italic when an onmousedown event occurs.
Code example: http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/fontStyle.htm
<div onmousedown="this.style.fontStyle='italic'">
See also
Send comments about this topic to Microsoft
Build date: 11/29/2012