document.tags.fontWeight

JavaScript 1.2+ Nav4+ Syntax

document.tags.tagName.fontWeight

Description

The fontWeight property specifies the font weight used by an element when associated with the tag called tagName.

The fontStyle property can be assigned one of the following values: normal, bold, bolder, lighter, or a number from 100 to 900.

Example

Listing 7.178 uses the fontWeight property to set different levels of weight on various text.

Listing 7.178 Set the fontWeight Property
<html>

<script>
<!-- Hide

//Create a style sheet tags that defines a font style
document.tags.P.fontWeight = 100;
document.tags.I.fontWeight = 900;

//Hide End --->
</script>

<p>Font weight of 100</p>
<i>Font weight of 900</i>

</html>
							
						

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.