Normally, only certain replaced elements have an aspect ratio, particularly images. For them, if only one of width and height is specified, the other can be computed from it using the intrinsic aspect ratio. This property allows explicitly specifying an aspect ratio for any other element to get similar behavior.
Motivation
Generalizes the aspect ratio concept to general elements. This allows various effects, for example sizing <iframe> elements using an aspect ratio, things like filmstrips where each element has the same height but needs an appropriate width, cases where a replaced element is wrapped by a component but should keep the aspect ratio, etc.
Demo
Specification
Status in Chromium
Enabled by default (tracking bug) in:
- Chrome for desktop release 88
- Chrome for Android release 88
- Android WebView release 88
Consensus & Standardization
- In development
- No signal
- No signal
- Positive
Owners
Intent to Prototype url
Intent to Prototype threadSearch tags
aspect-ratio, aspect, ratio,Last updated on 2021-01-20