CSS font Property
Description
The font shorthand property provides a single, compact way to set multiple font-related longhand properties at once. It is used to express the overall typographic appearance — such as family, size, weight, style and related metrics — from a single declaration, which makes rules shorter and helps keep typography consistent when you want several font aspects to change together.
Using the shorthand is effectively atomic: it assigns values to a collection of individual font properties and any subproperties not explicitly given in the shorthand are reset to their initial values. Because many of the individual font properties are inherited by default, applying the shorthand on an ancestor often cascades those settings to descendants. When you need to affect only one aspect of the font (for example adjusting only the font-weight or only the line-height), prefer the corresponding longhand; otherwise the shorthand can unintentionally overwrite other font-related settings such as font-style or font-variant.
From a practical and maintenance perspective, the shorthand is excellent for defining complete typographic rules for components or sections (for example, a site’s body text or a set of headings) because it reduces repetition and makes the intent explicit. Be mindful that newer or more specialized font features that are not included in the shorthand—such as variable-font axes or explicit variation settings—need to be set with their own properties (for example font-variation-settings). Also remember that the cascade still applies: later rules and more specific selectors override earlier shorthand declarations, and using the shorthand will override any earlier longhand values for the same font aspects. Finally, for predictable results, consider grouping font-related decisions (family, size, weight, and metrics) consciously so that the shorthand’s resetting behavior doesn’t remove intentional longhand customizations like a previously set font-stretch or an explicit font-size adjustment.
Definition
- Initial value
- See individual properties
- Applies to
- All elements
- Inherited
- Yes
- Computed value
- See individual properties
- Animatable
- See individual properties
- JavaScript syntax
- object.style.font
Interactive Demo
Syntax
font: [ [ <font-style> || <font-variant> || <font-weight> || <font-stretch> ]? <font-size> [ / <line-height> ]? <font-family> ] | caption | icon | menu | message-box | small-caption | status-bar
Values
- <font-style>See the font-style CSS property for values.
- <font-variant>See the font-variant CSS property for values.
- <font-weight>See the font-weight CSS property for values.
- <font-size>See the font-size CSS property for values.
- <font-family>See the font-family CSS property for values.
Example
Browser Support
The following information will show you the current browser support for the CSS font property. Hover over a browser icon to see the version that first introduced support for this CSS property.
This property is supported by all modern browsers.
Desktop
Tablets & Mobile
Last updated by CSSPortal on: 1st January 2026
