From the course: CSS: Float-Based Page Layouts (2012)
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Floating elements - CSS Tutorial
From the course: CSS: Float-Based Page Layouts (2012)
Floating elements
Of all the different properties involved in CSS layout, perhaps the most important to learn and master is the float property. Floating allows us to alter the normal position of an element by moving it to the leftmost or rightmost edge of its parent. That may not sound like such a big deal, but floating forms the basis for the overwhelming majority of CSS site layouts. Of course there's a little more to it than just moving elements from side to side, and in this chapter we're going to focus on the ins and outs of floating. We're going to start by examining the property in action. So I have the float.htm file open from the 03_01 directory. I'm just going to give you a brief preview of the structure of the page. If I scroll down into the body of it, you'll notice that we've got a couple of introductory paragraphs, and then we have three empty div tags with the classes elements 1, 2 and 3, and that is who we're going to control. Now if I preview this in my browser, you can see kind of…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
Floating elements7m 50s
-
(Locked)
Clearing floats7m 28s
-
(Locked)
Containing floats7m 50s
-
(Locked)
Clearfix technique10m 38s
-
Floating inline elements14m 34s
-
(Locked)
Two-column floated layouts8m 17s
-
(Locked)
Three-column floated layouts11m 30s
-
Column height considerations7m 3s
-
(Locked)
Creating equal-height columns10m 42s
-
(Locked)
Floats: Lab5m 25s
-
Floats: Solution5m 21s
-
(Locked)
-
-
-
-
-
-