aspect ratio
The proportion of an element's width to its height, such as 16:9.
In more detail
It is written as two numbers, such as aspect-ratio: 16 / 9. Giving images width and height attributes, or setting aspect-ratio in CSS, lets the browser reserve the right space before the image loads, preventing layout shift.
Related terms
- Cumulative Layout Shift — A Core Web Vital scoring how much visible content unexpectedly jumps around while a page is in use.
- next/image — The Next.js Image component, which resizes, converts and lazy-loads images and reserves their space to prevent layout shift.
- Cumulative Layout Shift — A Core Web Vitals score measuring how much visible content unexpectedly jumps while a page loads.
Taught in
- Core Web Vitals: Measuring And Optimizing LCP, INP, And CLS — Frontend Architecture & Web Platform
- Image & Font Optimization: Zero Layout Shift Assets — Next.js 15 & Modern App Router Architecture