6 out of 6 rated this helpful - Rate this topic

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 ToAll elements
Mediavisual
Inheritedtrue
Initial Valuenormal

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

CSSStyleDeclaration
currentStyle
defaults
runtimeStyle
style
font

 

 

Send comments about this topic to Microsoft

Build date: 11/29/2012

Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.