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 one of the following values:
normal Font is normal. italic Font is italic. oblique Font is italic. The property is read/write with 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 Dynamic Properties.
Remarks
The oblique value is available as of Internet Explorer 4.0. Internet Explorer 4.0 renders italic and oblique identically.
Example
The following examples use the font-style attribute and the fontStyle property to change font characteristics.
This example uses H3 as a selector to set the font style to italic in H3 headings.
Sample Code
<STYLE> H3 { font-style:italic } </STYLE>This feature requires Internet Explorer 4.0 or later. Click the icon below to install the latest version. Then reload this page to view the sample.This example uses inline scripting to set the font style to italic when an onmousedown event occurs.
<DIV onmousedown="this.style.fontStyle='italic'">
Applies To
A, ADDRESS, B, BIG, BLOCKQUOTE, BODY, BUTTON, CAPTION, CENTER, CITE, CODE, COL, COLGROUP, currentStyle, custom, DD, DFN, DIR, DIV, DL, DT, EM, FIELDSET, FORM, Hn, HTML, I, IMG, INPUT type=button, INPUT type=checkbox, INPUT type=file, INPUT type=image, INPUT type=password, INPUT type=radio, INPUT type=reset, INPUT type=submit, INPUT type=text, ISINDEX, KBD, LABEL, LEGEND, LI, LISTING, MARQUEE, MENU, OL, P, PLAINTEXT, PRE, runtimeStyle, S, SAMP, SELECT, SMALL, SPAN, STRIKE, STRONG, style, SUB, SUP, TABLE, TBODY, TD, TEXTAREA, TFOOT, TH, THEAD, TR, TT, U, UL, VAR, XMP
See Also