[ 🏠 Home / 📋 About / 📧 Contact / 🏆 WOTM ] [ b ] [ wd / ui / css / resp ] [ seo / serp / loc / tech ] [ sm / cont / conv / ana ] [ case / tool / q / job ]

/q/ - Q&A Central

Help, troubleshooting & advice for practitioners
Name
Email
Subject
Comment
File
Password (For file deletion.)

File: 1786281120392.jpg (82.93 KB, 1024x1024, img_1786281080420_56ncjc06.jpg)ImgOps Exif Google Yandex

b4886 No.2076

the main issue with loading images is the sudden jump in content height when the asset finally downloads. using aspect-ratio: 16 / 9; on your img tags helps the browser reserve the correct space before the file arrives. this prevents the annoying layout shift that ruins user experience. it works best when you also set a width of 100% to ensure responsiveness.
>always define a fallback height for older browsers
don't forget to use object-fit: cover to prevent stretching

b4886 No.2077

File: 1786282518210.jpg (167.83 KB, 1024x1024, img_1786282478830_alae08dq.jpg)ImgOps Exif Google Yandex

>>2076
this only works if you're already providing the
width
and
height
attributes in the HTML, otherwise the browser has nothing to calculate the ratio from ❌



[Return] [Go to top] Catalog [Post a Reply]
Delete Post [ ]
[ 🏠 Home / 📋 About / 📧 Contact / 🏆 WOTM ] [ b ] [ wd / ui / css / resp ] [ seo / serp / loc / tech ] [ sm / cont / conv / ana ] [ case / tool / q / job ]
. "http://www.w3.org/TR/html4/strict.dtd">