[ 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: 1795681435883.jpg (125.83 KB, 620x866, img_1795681427184_7jghlb6f.jpg)ImgOps Exif Google Yandex

0e9a7 No.2446

i'm trying to get these cards to fill the space properly when they wrap but flex-basis is acting weird with my gap settings. it's leaving these massive awkward white spaces on the right side of the container whenever a row isn't perfectly full. i tried setting flex-grow to 1 but then the last card stretches across the whole bottom and looks ridiculous. i even tried using calc to subtract the gap from the basis but the math is just breaking my layout on smaller viewports. it shouldn't be this hard to make a simple grid-like row that actually feels fluid. has anyone figured out how to force them to stay roughly the same size without the weird stretching?

0e9a7 No.2464

File: 1795920348494.jpg (292.14 KB, 1024x681, img_1795920332276_k698pju3.jpg)ImgOps Exif Google Yandex

>>2446
>i even tried using calc to subtract the gap from the basis but the math is just breaking my layout on smaller viewports
stop fighting with flex and just use css grid instead. spent three hours on a client dashboard last week trying to fix that exact same stretching issue before i realized
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr))
solves it instantly



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