document.tags.fontSize
JavaScript 1.2+ Nav4+ Syntax
document.tags.tagName.fontSize
Description
The fontSize property specifies the size of fonts used by an element when associated with the tag called tagName. The values that can be used to set font size can be divided into four categories as shown in Table 7.21.
Category | Value |
---|---|
Absolute | xx-small |
x-small | |
small | |
medium | |
large | |
x-large | |
xx-large | |
Relative | smaller (relative font size of parent) |
larger (relative font size of parent) | |
Length | A number followed by a unit of measurement. |
Percentage | The size relative to font size of parent. |
Example
Listing 7.176 uses absolute font sizing to define the fontSize property and associate it with text.
Listing 7.176 Set ...
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.