Bummer! This is just a preview. You need to be signed in with a Treehouse account to view the entire video.
Why Floats are Used in Web Design0:56 with Guil Hernandez
Floats are one of the most commonly used methods for laying out a page with CSS. With a float, surrounding content is able to flow down the right or left side of an element.
Floats are one of the most commonly used methods for laying out a page with CSS.
To understand the purpose and origin of floats, we can refer to print design,
where images are often laid out on the page, and text wraps around them.
With a CSS float, an element is first laid out according
to the normal document flow, then taken out of that flow and
placed along the left or right side of its container.
That way, content can flow down the right or
left side of the element, depending how it's floated.
But as we'll soon learn, when a CSS layout
relies on floated elements, things can get overly complex.
In this stage we'll layout the same header, navigation, and columns
we used in the previous stage, this time using the float method.
That way we'll have a clear understanding of how
float layout works, the common layout bugs that
come with using them, and how to fix them.
You need to sign up for Treehouse in order to download course files.Sign up