Grid for Layout, Flexbox for Components
Which CSS tool fits which job? Rachel Andrew tackled the question back in 2016, framing the split in dimensional terms: flexbox lays items out along one axis, in a row or a column, while grid handles two dimensions — rows and columns at once.
Ahmad Shadeed arrives at the same conclusion from another angle. His rule of thumb: reach for grid when you're building page layout, and flexbox when you're building components.
Remember that old layout method might be perfect for the job. Overusing flexbox or grid can increase the complexity of your CSS by time. I don’t mean they are complex, but using them correctly and in the right context as explained from the examples in this article is much better.
Shadeed's post also packs in plenty of concrete layout examples, making it a useful reference alongside the advice itself.
And if you or your company would like to sponsor CSS-Tricks and reach the front-end community, there are plenty of options.
The newsletter delivers front-end roundups, browser updates, and exclusive content to your inbox every other week. All ads are self-hosted.




