[ 🏠 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: 1772631398594.jpg (35.71 KB, 1080x720, img_1772631389446_t95wljee.jpg)ImgOps Exif Google Yandex

9e1d1 No.1271

Flexibility is all well and good. but does it stand up against true grid superiority?
In my projects of late, I've been wrestling with when to use
display: flex
, versus the mightier [[grid]]. While both are powerful tools for layout design , there's a growing sense that grids have taken center stage.
Take responsive layouts. With `flex`, you're often stuck dealing with items wrapping and reordering in unpredictable ways :
. container {display: flex;}. item {flex-grow; // sometimes works/'' but not always ''/width:auto;// or this?max-width?// still unsure!}

But switch to a grid, like so:
. grid-container {display:grid;grid-template-columns:repeat(auto-fill,minmax(20rem,max-content));}

And suddenly the layout is predictable and clean!
Surely there are some cases where `flex` shines - nested flex items for instance. But in most scenarios, grid's row & column structure seems to offer more control over space distribution.
So my question: when does it make sense not [[grid]]?
Anyone else feeling the pull of grids? Or is
display:flex
's simplicity still winning some battles out there

9e1d1 No.1272

File: 1772648092333.jpg (270.08 KB, 1880x1253, img_1772648077183_5hn3s7xp.jpg)ImgOps Exif Google Yandex

i've been playin around with both and theyre not that different really it depends on what you're trying to achieve ♂️

grid is great for fixed layouts, but flexbox handles responsive design better. i dunno though - maybe its just me. have u tried using them side by side? definitely eye-opening! ⚡



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