3 ms·
For the projects I use, Flexbox gets it done 95% of the time. Just occasionally Grid is the better method. The only thing I can think of off the top of my hea
by reaperducer 8y ago
For the projects I use, Flexbox gets it done 95% of the time. Just occasionally Grid is the better method.
The only thing I can think of off the top of my head is that if you're doing something programmatically and don't know how many items will appear in a grid, then Grid is better because Flexbox doesn't handle orphans well.
Some have suggested using the margin-right: auto; trick, but it doesn't always work if you have your elements even moderately styled with padding and borders and such.
If there was something like justify-content: space-between left-hanging; or justify-content space-between right-hanging; that would be ideal.