aspect-ratio Property
The aspect-ratio property maintains a fixed width/height ratio as elements resize, replacing the old padding-bottom hack.
The aspect-ratio property maintains a fixed width/height ratio as elements resize, replacing the old padding-bottom hack.
.video { width: 100%; aspect-ratio: 16 / 9; }
.square-thumb { width: 80px; aspect-ratio: 1; object-fit: cover; border-radius: 50%; }
.card-img { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; }
aspect-ratio prevents layout shift (CLS) by reserving space before content loads.