Web features explorer

aspect-ratio

Widely available since 2024-03-20
Tags: css html Groups: CSS

The aspect-ratio CSS property controls the width-to-height ratio of elements. For <img> and <video> elements, the width and height attributes used together with height: auto control the aspect ratio while the image/video is loading.

Learning resources on MDN

Browser support