0

I have a flex layout for a number tiles (of fixed size. Number of tiles and container width will vary) , using:

.container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

enter image description here

My tiles have a fixed size and I like the space being ditributed evenly. With the exception of the last row, that I would like to end as justified text would usually end, with the last element(s) not being stretched to full width but rather end naturally (green square). – Any way to achieve this?

m4n0
  • 29,823
  • 27
  • 76
  • 89
Frank N
  • 9,625
  • 4
  • 80
  • 110
  • So many duplicates...lemme look – Paulie_D Jun 20 '18 at 14:55
  • Centering is not what I want, because space is not distributed inbetween (≠ justify), however [18744164](https://stackoverflow.com/questions/18744164/flex-box-align-last-row-to-grid) is close (though unlike me about expanding, not fixed-size tiles…) and then [2nd highest rated solution looks pretty good](https://stackoverflow.com/a/22018710/444255) . – Frank N Jun 20 '18 at 16:12
  • 1
    Above solution is truly brilliant: https://codepen.io/dalgard/pen/Dbnus – Frank N Jun 20 '18 at 16:59

0 Answers0