Export (0) Print
Expand All
top
Expand Minimize
This topic has not yet been rated - Rate this topic

fontWeight property

Gets of sets the weight of the font of the object.

CSS 2.1, Section 5.2.5

Syntax

Integer value = object.put_fontWeight( v);Integer value = object.get_fontWeight(* sWeight);

Property values

Type: BSTR

normal (normal)

Font is normal.

bold (bold)

Font is bold.

bolder (bolder)

Font is at least as bold as the default bold weight.

lighter (lighter)

Font is lighter than normal.

100 (100)

Font is at least as light as the 200 weight.

200 (200)

Font is at least as bold as the 100 weight and at least as light as the 300 weight.

300 (300)

Font is at least as bold as the 200 weight and at least as light as the 400 weight.

400 (400)

Font is normal.

500 (500)

Font is at least as bold as the 400 weight and at least as light as the 600 weight.

600 (600)

Font is at least as bold as the 500 weight and at least as light as the 700 weight.

700 (700)

Font is bold.

800 (800)

Font is at least as bold as the 700 weight and at least as light as the 900 weight.

900 (900)

Font is at least as bold as the 800 weight.

String format

normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900

CSS information

Applies ToAll elements
Mediavisual
Inherited1
Initial Value

Standards information

Remarks

Keywords for IHTMLCSSStyleDeclaration::fontWeight values are mapped to specific font variations depending on the fonts that are installed on the user's computer. In many cases, the user cannot see the difference between different IHTMLCSSStyleDeclaration::fontWeight settings because the system chooses the closest match.

Setting the IHTMLCSSStyleDeclaration::fontWeight to 400 is equivalent to normal, and to 700 is equivalent to bold. An IHTMLCSSStyleDeclaration::fontWeight of bolder or lighter is interpreted relative to the parent object's weight. A value of bolder for text whose parent is normal sets the text to bold.

To convert these strings to numeric equivalents, use the read-only IHTMLCurrentStyle::fontWeight property.

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

IHTMLCSSStyleDeclaration::font

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.