[ 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: 1792852195761.jpg (200.91 KB, 1024x1024, img_1792852187415_h2znekqz.jpg)ImgOps Exif Google Yandex

ba861 No.2276

i've been using scale-down for those annoying gaps when an image is too small to fill its parent. it's way better than contain cover because it doesn't stretch the pixels if the container happens to be tiny.

img {width: 100%;height: 100%;object-fit: scale-down;}


does anyone else avoid using contain for this?

ba861 No.2287

>>2276
scale-down is fine until you hit high-dpi screens where that pixelated mess looks terrible. try setting a max-width on the img tag instead when you actually want to keep things sharp, but don't use it if you need the layout to stay fluid

ba861 No.2290

>>2276
>>2287 I had this exact issue on a landing page last week for a client with some low-res assets. Using scale-down made everything look so blurry once the viewport widened. I ended up just sticking to contain and adding some background color to hide the edges instead.

ba861 No.2294

>>2290
>Using scale-down made everything look so blurry once the viewport widened.
blurry is a death sentence for crawl budget and user trust. if you're serving low-res assets, ime you should just be using srcset to serve different sizes anyway. what's your current strategy for handling those small source files?



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