Easy Tutorial
❮ Met Dialog Show Event Onfocusout ❯

Style font Property


Definition and Usage

The font property sets or returns up to six individual font properties in a shorthand form.

Using this property, you can set/return:

It is strongly recommended to use separate properties for better control.

Syntax

Set the font property:

Return the font property:

Note: The font property has no default value.

Value Description
style Sets the font style.
variant Sets the text to be displayed in a small-caps font.
weight Sets the font weight.
size Sets the font size.
lineHeight Sets the distance between lines.
family Sets the font family.
caption Defines the font used by controls (e.g., buttons, dropdowns).
icon Defines the font used for labeling icons.
menu Defines the font used in menus.
message-box Defines the font used in dialog boxes.
small-caption Defines the font used by small controls.
status-bar Defines the font used in window status bars.
inherit The value of the font property is inherited from the parent element.

Browser Support

All major browsers support the font property.

Note: IE7 and earlier versions do not support the "inherit" value. IE8 requires a !DOCTYPE to support "inherit". IE9 supports "inherit".


Example

Change the font of the text:

❮ Met Dialog Show Event Onfocusout ❯