CSS CSS Flexbox Layout Building a Layout with Flexbox Creating a Sticky Footer with Flexbox

Matthew Lang
Matthew Lang
13,466 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
PRO
Christopher Debove
Pro Student 18,366 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,607 Points

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

Matthew Lang
Matthew Lang
13,466 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,607 Points

I think that makes sense Matthew.