flexbox or grid for a card layout that wraps?

cssflexboxgridresponsive73 replies 路 955 views 路 started
  1. hmmmm ok say you have a variable number of cards and want a repsonsive grid with no media queries, equal column widths, and a last row that doesnt stretch to fill the space.

    the obvoius approach with flex-wrap and a flex-basis almost works, but the last row always looks off when it holds fewer items: teh leftover cards grow to fill the whole width. I could hack it with invisible spacer elements, but that feels wrong.

    flexbox gets close but not quite, what's the idiomatic way to do this now??

    5
  2. @solsen is there a minimum card width below which it should switch to a single column on phones? worked for me anyway 馃し

    0 2 helpful
  3. hmmm content heights vary because some product names are long. minimum width around 240px is fine; on phones one column is what i'd expect anyway. cards hold an image, a name, a price and a button.

    3 0 helpful
  4. try turning off the fan curve first, fixed it for me fingers crossed 馃

    0 5 helpful
  5. spent since tuesday on responsive and im still not done. which version are you on?? pls help 馃檹

    0 5 helpful
  6. so annoyed rn i swear layout is cursed. bump. still happening with flexbox for me

    1 3 helpful
  7. @heapmonk thank u this worked!! seriously made my day 馃槶馃檹

    party

    35 0 helpful
  8. @heapmonk thank u this worked!! seriously made my day 馃槶馃檹

    lol no

    0 4 helpful
  9. hmmmm quick q is wraps even worth bothering with or should i just leave it

    2 1 helpful

Reply to this topic

Sign in or create an account to reply.