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 Layout Basics Page Layout with the Float Property Wrapping Text Around Images with Floats

Nour El-din El-helw
Nour El-din El-helw
8,241 Points

Difference Between Inline-block And Floats

Can someone please clarify the difference between an element with the display value "inline-block" and an element that with left/right float value? Thanks in advance.

1 Answer

eslam said
PLUS
eslam said
Courses Plus Student 6,734 Points

Inline block elements will stack next to other items, like images, spans, a Elements that are floated are not in the normal flow of the document that's why when you float elements it loses its height and you need to clear it,

Overall floating elements is such an old way to layout things, now you have flexbox and css grid which both are great to layout your page.