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 Creating a Sticky Footer with Flexbox

Matthew Lang
Matthew Lang
13,483 Points

Does Flexbox make Floats obsolete?

From the looks of it, I have no need to use floats at all anymore. Flexbox just seems like the much more easier, simpler way... I'm sure there are things that specifically require floats, but what are they?

3 Answers

Christopher Debove
PLUS
Christopher Debove
Courses Plus Student 18,373 Points

You can use float for their real purpose. Make an element float on the left or the right (like an image in a newspaper article =)). Using float to align items was not the real purpose of float.

Daniel Tkach
Daniel Tkach
7,608 Points

I'd like to know this as well, I did not understand Christopher's answer.

Matthew Lang
Matthew Lang
13,483 Points

I think I understand now. So, flexbox is all good for layouts etc, however when you have, lets say, a blog post, and you have loads of text and paragraphs etc. Though you want an image also of a product, and you want the text to wrap around the image, well in this case you'd use a float to make the image float to the left/right side, allowing the text to flow around it. Making it all a flex box simply would be too much hassle, and in this case a float would be better.

Sorry if that just confused you even more...

Daniel Tkach
Daniel Tkach
7,608 Points

I think that makes sense Matthew.