Name

font — NN n/a IE 4 DOM n/a

Synopsis

Read/Write

A shorthand property that lets you set one or more font-related properties (fontFamily, fontSize, fontVariant, and fontWeight) with one assignment statement. A space-delimited list of values (in any sequence) is applied to the specific font properties for which the value is a valid type.

Example

document.all.subhead.style.font = "bolder small-caps 16pt"

Value

For syntax and examples of value types for font-related properties, see the respective property listing.

Default

None.

Get Dynamic HTML: The Definitive Reference 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.