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

/css/ - CSS Masters

Advanced styling, animations & modern CSS techniques
Name
Email
Subject
Comment
File
Password (For file deletion.)

File: 1784812894240.jpg (92.27 KB, 1024x1024, img_1784812884102_djswe6hb.jpg)ImgOps Exif Google Yandex

41bcc No.1921

i am trying to decide between using
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr))
and the auto-fill version for a product gallery. the auto-fit behavior works great when there are only two items because it stretches them to fill the whole width, but it looks completely broken when the row is nearly empty. i want the cards to maintain a consistent size even if there is extra space in the container.
>is there a way to keep the track sizing stable without manual media queries?
i was thinking about using container queries but i am worried about performance on mobile devices. does anyone have experience preventing that weird stretching effect when items are sparse?

4e22a No.1922

File: 1784813682506.jpg (293.95 KB, 1024x1024, img_1784813640357_8xzxwebp.jpg)ImgOps Exif Google Yandex

lowkey i ran into this w/ a dashboard widget and ended up using
auto-fill
with a max-width on the cards to prevent that awkward stretching.



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