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
Kristian Woods
23,414 PointsIs using Flexbox for all of your projects a bad idea?
I know there are a few ways to create the same layout result in CSS, however, I really favour Flexbox. It feels easier to use, plus you don't need to worry about inline/block display modes, not to mention the fact you don't have to bother with floats and collapsing parents, amongst other advantages. However, I know there will be times when using floats etc will be necessary.
My question is; can you use Flexbox for all types of projects without feeling like you're not utilising CSS to the best of its ability? I almost feel like I'm cheating in my layout because Flexbox is, in my opinion, easier to use. Should I not rely on it so heavily, and use it sparingly?
Thanks in advance
K
1 Answer
Joel Bardsley
31,258 PointsMany are using Flexbox in production, and Zurb Foundation v6 currently provides a flexbox-supported version of their grid system. Bootstrap v4 will also include it, but it's still in alpha as of writing.
I currently don't use Flexbox in production as my clients mostly require support down to IE8, but I'm looking forward to being able to use it and wouldn't consider it 'cheating' once the time comes. I expect some felt the same way when switching over from table layouts to divs, but technology evolves to make our lives easier so why not take advantage of it - as long as it works, that's the main thing.
Just be aware of the current limitations flexbox support in IE and apply fallbacks or use a polyfill where necessary.