Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS Unused CSS Stages Flexbox and Multi-Column Layout Flexbox: Part 2

Paul Barron
Paul Barron
6,595 Points

Does Flexbox...

... replace grid systems? Should I think like this? What's your opinion?

2 Answers

Right now, flexbox is my method of choice when it comes to building site layouts. It's incredibly simple to understand and to work with, it's very malleable, it can do things that are just impossible for traditional methods (floats, inline-blocks, etc.), and all of that with a third of the rules and none of the potential layout breakdowns.

Literally, when I watched the first Treehouse flexbox video and saw Guil set up a flexbox navigation with one CSS declaration, it blew my mind. Ever since then, it's been my favorite CSS tool, even more so than transforms, transitions, and animations. I think that flexbox is the best thing to have hit CSS layout ever, even more important than the grid systems.

But I digress. I'm not sure if flexbox is a method. I think that it's more of a tool. An example: being dissatisfied with the various CSS frameworks out there, I've decided to develop my own to solve some common issues I run into. Through the power of Modernizr, my grid system uses flexbox for layout and falls back to floats and clearfixes if the browser (cough cough, IE) doesn't support flexbox. So right there, you see flexbox and grids working together. And flexbox is handling the grid system better than floats ever have.

TL;DR: Flexbox is a tool; grids are a system or a method. I've built a grid with flexbox, and it's awesome. Flexbox can be used for just about anything; that's why it's called flexbox.

Andrew Dushane
Andrew Dushane
9,264 Points

Personally, I think it's awesome and it could, but because browser support is limited we'll have to use more 'traditional' methods for the foreseeable future, at least as fallback design.