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 CSS Flexbox Layout Building a Layout with Flexbox Building a Navigation Bar with Flexbox

If we use Flexbox CSS properties, do we still need to use floats and inline or block properties?

In the workspace I saw both CSS properties being used.

2 Answers

Steven Parker
Steven Parker
231,269 Points

Depending on what you need to accomplish, you may use more than one tool in the same project but not necessarily on the same element. Clearly, any one element cannot have a display set to both "block" and "flex" at the same time. But you could use them on different elements.

On the other hand, since flexbox can do most anything you might use "float" for, but it gives you more control, once you're comfortable with flexbox you might tend to use it exclusively for those kind of layout needs.

Thank you, yes I am much more comfortable with Flexbox, I tend to get really confused about which classes and ids should receive what properties, I think I lack confidence as I don't really have had much real life practice in web developing.

Steven Parker
Steven Parker
231,269 Points

As you may suspect, you will acquire confidence along with experience. Just keep at it.

If you are already comfortable with flexbox, you're well on your way!

Happy coding!