The font CSS shorthand property sets all the different properties of an element's font. Alternatively, it sets an element's font to a system font.


Initial value as each of the properties of the shorthand:font-style: normalfont-variant: normalfont-weight: normalfont-stretch: normalfont-size: mediumline-height: normalfont-family: depends on user agent
Applies to all elements. It also applies to ::first-letter and ::first-line.


font: 1.3em "Rubik", serif;


See the font-style CSS property.
See the font-variant CSS property.
See the font-weight CSS property.
See the font-stretch CSS property.
See the font-size CSS property.
See the line-height CSS property.
See the font-family CSS property.
The system font used for captioned controls (e.g., buttons, drop-downs, etc.).
The system font used to label icons.
The system font used in menus (e.g., dropdown menus and menu lists).
The system font used in dialog boxes.
The system font used for labeling small controls.
The system font used in window status bars.
Browsers often implement several more, prefixed, keywords: Gecko implements -moz-window, -moz-document, -moz-desktop, -moz-info, -moz-dialog, -moz-button, -moz-pull-down-menu, -moz-list, and -moz-field.

Browser support


We use cookies to improve your experience. Learn more in our Privacy policy.