Preventing Layout Shifts with CSS aspect-ratio
When web pages load images or video embeds without predetermined height dimensions, the browser dynamically reflows the page as media assets finish downloading. This causes jarring Cumulative Layout Shifts (CLS), damaging Google Core Web Vitals scores.
Modern Aspect Ratio Standards
- 16:9 (1.7778): The international widescreen video standard for YouTube, Vimeo, and modern desktop video players.
- 9:16 (0.5625): Vertical full-screen smartphone orientation used by TikTok, Instagram Reels, and YouTube Shorts.
- 1:1 (Square): Standard for profile avatars, product thumbnail grids, and social post cards.
- 21:9 (2.3333): Anamorphic ultrawide aspect ratio for cinematic trailers and panoramic banner headers.