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 How to Make a Website Responsive Web Design and Testing Build a Three Column Layout

What does float actually do? I am having a difficult time understanding its function.

What does float actually do? I am having a difficult time understanding its function.

2 Answers

Basically, it allows you to push elements as far left or right as they can go without having to re-arrange your HTML.

I commonly use it for images and things like that but is also used heavily for layouts. Non-floated elements will wrap around a floated element too.

Hope this helps.

Louis Otto
Louis Otto
23,264 Points

Imagine smaller divs as boats inside a harbour (the wrapper div).

You can choose whether a boat will be on the lefthand or righthand side by selecting where it 'floats'.

This is a really layman way of describing it, but you can learn more here: http://www.w3schools.com/css/css_float.asp