5 ms·
Are you sure you know flexbox and grid well? I don’t see how you could prefer floats.
by sixQuarks 6y ago
Are you sure you know flexbox and grid well? I don’t see how you could prefer floats.
- petepete 6y agoGrid and flex let you do in five lines what used to take fifty. I'd never go back.
- eurasiantiger 6y agoThank you for your quadratic-or-worse layout calculations. Then people wonder why the web eats their phone battery.
- wwweston 6y agoFloats have their place. The conceptual model is simpler for some simple cases, and you can build layouts that reflow over different viewport sizes without worrying about breakpoints. Once you need equal-height boxes in your layout, though, it's time to use something else.
- eurasiantiger 6y agoThey are faster to render especially when resizing the window, and they work in the exact same mental model of layout as everything else in CSS: the box grows to fit its content. Flexbox and grid do not subscribe to this: flexbox shrinks/grows its content to fit itself. Grid is a configurable beast, something in between, and also makes it possible for grid content (not the container) to define how it itself is laid out.