Name
fontWeight — NN n/a IE 4 DOM n/a
Synopsis
Read/Write
Sets the weight (boldness) of the element’s font. CSS provides
a weight rating scheme that is more granular than most browsers
render on the screen, but the finely tuned weights may come into play
when the content is sent to a printer. The scale is a numeric rating
from 100 to 900 at 100-unit increments. Therefore, a
fontWeight of 100 would be the least bold that
would be displayed, while 900 would be the boldest. A setting of
normal (the default weight for any font) is
equivalent to a fontWeight value of
400; the standard bold setting is equivalent to
700. Other settings (bolder and
lighter) let you specify a weight relative to the
parent element’s weight.
Example
document.all.hotStuff.style.fontWeight = "bold"
Value
Any of the following constant values: bold |
bolder | lighter |
normal | 100 |
200 | 300 |
400 | 500 |
600 | 700 |
800 | 900.
Default
normal
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access