Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS CSS Layout Basics Page Layout with the Float Property Creating a Horizontal Navigation with Floats

Nick Caligari
Nick Caligari
3,052 Points

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
215,960 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.