CSS aspect-ratio Property Reference

The CSS aspect-ratio property is a standard property in CSS Box Sizing. Review its formal syntax, computed behavior, and practical declarations.

CSS aspect-ratio Property Reference

The CSS aspect-ratio property is a standard property in CSS Box Sizing. Review its formal syntax, computed behavior, and practical declarations.

Updated 2026-08-12

aspect-ratio overview

The CSS aspect-ratio property is a standard property in CSS Box Sizing. Review its formal syntax, computed behavior, and practical declarations.

The property is not inherited by default. Use an explicit global keyword when inheritance is intended.

Syntax and formal definition

aspect-ratio formal syntax
FieldValue
Formal syntaxauto || <ratio>
Initial valueauto
Applies toallElementsExceptInlineBoxesAndInternalRubyOrTableBoxes
InheritedNo
Percentagesno
Computed valueasSpecified
Animation typebyComputedValueType
Mediaall
Specification groupCSS Box Sizing
StatusStandard

Practical examples

These declarations demonstrate valid ways to set aspect-ratio. The initial and inherit global keywords remain available even when a property-specific value is preferable.

aspect-ratio live example
CSS .reset-example { aspect-ratio: initial; } .inherit-example { aspect-ratio: inherit; } @supports (aspect-ratio: initial) { .supported { aspect-ratio: initial; } }

Description

The CSS aspect-ratio property is a standard property in CSS Box Sizing. Review its formal syntax, computed behavior, and practical declarations.

References

  1. MDN: aspect-ratio
  2. MDN: CSS Properties Reference

Similar or alternative tools

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies