4 ms·
Flexbox: distributing a variable number of elements, like an image gallery. Float: in sections where there could be a variable number of columns, and the colum
by ino 9y ago
Flexbox: distributing a variable number of elements, like an image gallery.
Float: in sections where there could be a variable number of columns, and the columns could have variable possible widths, using floats can be simpler than grids.
This is because you have to maintain many different grids (and their media queries) for the parent display:grid elements, and with floats you're only styling child elements.
- themarkn 9y agoI'm not sure I follow your second example. I might need more detail to understand how grid-auto-columns (https://developer.mozilla.org/en-US/docs/Web/CSS/grid-auto-columns https://developer.mozilla.org/en-US/docs/Web/CSS/grid-auto-c...) does not meet this use case? It's possible I haven't been in the weeds enough on grid yet.