Layout

CSS aspect-ratio Calculator

aspect-ratio locks width and height together. Set 16 / 9 and the browser calculates height from width. No padding-top percentage trick or absolute positioning.

/

Simplified: 16 / 9 · padding hack: 56.25%

How the image fills the ratio box when content does not match.

Modern CSS
420px wide
Container width 420px
Widely availableSince 202195% global usage

This feature is well established and works across many devices and browser versions. It has been available across browsers since 2021.

Safe to use without fallbacks.

88+
89+
15+
88+
ESC