document.ids.fontSize

JavaScript 1.2+ Nav4+ Syntax

document.ids.idName.fontSize

Description

The fontSize property specifies the size of fonts used by an element when associated with the ID called idName. The values that can be used to set font size can be divided into four categories, as shown in Table 7.17.

Table 7.17. Font Sizes
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)
LengthA number followed by a unit of measurement
PercentageThe size relative to font size of parent

Example

Listing 7.118 uses absolute font sizing to define the fontSize property and associate with text.

Listing 7.118 Set the fontSize ...

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.