[ 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: 1790567191564.jpg (209.79 KB, 1024x1024, img_1790567183412_l3bdptj2.jpg)ImgOps Exif Google Yandex

cb3ae No.2147

been messing with some old legacy layouts today. i've been trying to move away from those old padding-top hacks for aspect ratios because they're such a headache when you actually need the content to behave. using the modern aspect-ratio property is way cleaner, but it's driving me crazy when the source images aren't perfectly sized. if you don't pair it with object-fit: cover, you just get these stretched, ugly distortions that look terrible on high-density mobile screens.

.card-img {aspect-ratio: 16 / 9;object-fit: cover;}


it's much easier than managing the old padding trick. at least until the browser decides to ignore your life's work. does anyone actually still use the padding hack for anything?


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