CSS font Property


The CSS font is used to define the HTML element's font content.

Syntax

Example

Preview

Property Values

Value Description
font-style This property specifies the font style. The default setting is "normal."
font-variant This property specifies the font variant. The default setting is "normal."
font-weight The font weight is specified. The default setting is "normal."
font-size/line-height The font size and line-height are specified. The default setting is "normal."
font-family The font family is specified. The default value is determined by the browser.
caption Uses the font used by captioned controls (like buttons, drop-downs, etc.).
icon The font used by icon labels is used.
menu The fonts used by dropdown menus are used.
message-box Uses the fonts that dialogue boxes use.
small-caption The caption font is smaller.
status-bar The fonts used by the status bar are used.
initial This property is set to its default value.
inherit This property is inherited from its parent element.

Supported Browsers

Element Chrome Firefox Safari Edge / IE Opera
font 1.0 1.0 1.0 4.0 3.5