fontWeight property

[This documentation is preliminary and is subject to change.]

Sets or retrieves the weight of the font of the object.

CSS 2.1, Section 5.2.5

Syntax

Integer value = object.put_fontWeight(BSTR v);Integer value = object.get_fontWeight(BSTR* 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 font-weight 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 font-weight settings because the system chooses the closest match.

Setting the font-weight to 400 is equivalent to normal, and to 700 is equivalent to bold. An font-weight 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 fontWeight property.

Microsoft Internet Explorer 4.0 supports only normal and bold.

Microsoft Internet Explorer 3.0 supports the font-weight attribute through the font attribute.

Requirements

Minimum supported client

Windows XP

Minimum supported server

Windows Server 2003

Header

DLL

Mshtml.dll

See also

font

 

 

Build date: 1/23/2012

Community Additions

Show: