Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

fontStyle property

Specifies the font style of the object as italic, normal, or oblique.

Syntax

Integer value = object.put_fontStyle( v);Integer value = object.get_fontStyle(* sStyle);

Property values

Type: BSTR

normal (normal)

Default. Font is normal.

italic (italic)

Font is italic.

oblique (oblique)

Font is italic.

String format

normal | italic | oblique

CSS information

Applies ToAll elements
Mediavisual
Inheritedtrue
Initial Valuenormal

Remarks

Windows Internet Explorer is shipped with a default IHTMLRuleStyle::fontStyle, but you can change this default in Internet Options.

Examples

This example uses IHTMLRuleStyle::fontStyle to display text in the default body element text font weight (italic), then display text in a normal font.


body {
  font-style: italic;
  font-family: 'Trebuchet MS', Arial, Helvetica, sans-serif;
}
.normalFontStyle {
  font-style: normal;
}


<body>
  <p>Lorem ipsum dolor sit amet... (font-style: italic)</p>
  <p class="normalFontStyle">Lorem ipsum dolor sit amet... (font-style: normal)</p>
</body>

The following image shows the result:

An image showing text with different font-weight settings.

Requirements

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Mshtml.h

IDL

Mshtml.idl

DLL

Mshtml.dll

See also

IHTMLRuleStyle::font

 

 

Community Additions

ADD
Show:
© 2015 Microsoft