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 Creating a Horizontal Navigation with Floats

Question about Floated Elements and their display property

Hi all,

Great video as always, but I am a little stumped by a concept that was introduced in the last video and after seeing this one, I think it is a good time to ask. Basically, when you float an element, I understand that it seems to adopt a block and inline level property, as Guil mentioned. However, here is my question: does the actual display value of whatever its the element was set to by default ACTUALLY change? As an example from the last video, I was under the impression that <img> element was an inline element by default. But when you float it, does it the display value actually change? Or, does it retain whatever value it was set to by default, and simply adopts block/and inline properties? I hope that makes sense!


1 Answer

Steven Parker
Steven Parker
230,248 Points

The use of float implies the use of the block layout, so it modifies the computed value of the display values in some cases.

For more details, see the MDN page on float.