Sets or retrieves the font style of the object as italic, normal, or oblique.
Syntax
HTML
{ font-style : sStyle }
Scripting
object.style.fontStyle [ =sStyle ]
Possible Values
sStyle
String that
specifies or receives one of the following values.
normal
Default. Font is normal.
italic
Font is italic.
oblique
Font is italic.
The property is read/write
for all objects except the following, for which it is read-only:
currentStyle.
The property has a default value of
normal. The Cascading Style Sheets (CSS) attribute is
inherited.
Expressions can be used in place of the preceding value(s), as of Microsoft® Internet Explorer 5. For more information, see>About Dynamic Properties.
Remarks
The oblique value is available as of Microsoft® Internet Explorer 4.0. Internet Explorer 4.0 renders italic and oblique identically.
While, Internet Explorer is shipped with a default fontStyle, this default can be changed by accessing Internet Options.
Examples
The following example shows how to use hn as a selector to set the font style to italic in H3 headings.
<STYLE>
H3 { font-style:italic }
</STYLE>
This feature requires Microsoft® Internet Explorer 4.0 or later. Click the following icon to install the latest version. Then reload this page to view the sample.
The following example shows how to use inline scripting to set the font style to italic when an onmousedown event occurs.
<DIV onmousedown="this.style.fontStyle='italic'">
This feature requires Microsoft® Internet Explorer 4.0 or later. Click the following icon to install the latest version. Then reload this page to view the sample.
Standards Information
property is defined in
Cascading Style Sheets (CSS), Level 1 (CSS1) .