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

/resp/ - Responsive Design

Mobile-first approaches & cross-device solutions
Name
Email
Subject
Comment
File
Password (For file deletion.)

File: 1794531731000.jpg (175.57 KB, 1024x1024, img_1794531722609_z7pjbfl7.jpg)ImgOps Exif Google Yandex

a5eee No.2373

still seeing people hardcode height: 500px on mobile cards. it's absolute madness when you have varying content lengths. just use aspect-ratio: 16/9 and let the browser handle the math. if the image is weirdly sized, at least it won't break your layout or create huge gaps of empty space. honestly, stop using fixed heights for anything dynamic. it makes the whole grid look broken on small screens.
.card-img {width: 100%;aspect-ratio: 4/3;object-fit: cover;}

tbh it's a single line of css and saves so much headache ⚠


[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 ]