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

inline-block vs flexbox

I wan to ask which is better to use for centering the stuff-

  1. setting the parent to text-align:center children to display:inline-block or
  2. using flexbox and justify-content property.

2 Answers

I think this comes down to preference and which works best for the situation you're working on. From what I've heard, Flexbox is still "new" so you may not see it as much as you would see the traditional way with inline-block. Having said that, it's probably important to be familiar with inline-block even if you prefer Flexbox so you can work with either and in any situation.

I personally really enjoy the little I've worked with Flexbox; the ease-of-use and flexibility it provides are very helpful. Again, I think it mainly comes down to preference and situation.

Thanks Braydon?