This course will be retired on July 12, 2021. We recommend "CSS Basics" for up-to-date content.
Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Start a free Courses trial
to watch this video
In this video, we’ll learn some of the basics of float layout.
Related Videos
Quick Reference
Floats are one of the most commonly used methods for laying out a page with CSS. When an element is floated, the element is taken out of the normal flow of the page and placed along the left or right side of its container.
The following will float an element over to the right side of its container:
.tips {
float: right;
}
The following will place the element along the left side of its container:
.tips {
float: left;
}
You need to sign up for Treehouse in order to download course files.
Sign up