Float containment


show more Float containment provides you with in-depth training on Web. Taught by Eric Meyer as part of the CSS Web Site Design show less
please wait ...

Float containment

What you see here is a situation where I've unfloated the columns for a moment and I've enclosed them in a container div, this is just generally what this sort of thing is called. There's a div that begins right before the content div and it ends right after the end of the sidebar div and these things usually have an ID of container. So there you go, div id equals container. That begins as I say before the content and it ends right after the end of the sidebar.

And this is the background color that I've given it. Now, the reason that these columns are floating is that I've actually written a rule to override the built-in float styles and let me get rid of that now, so that they actually float into place the way they are supposed to and when I hit Reload, there they are. But the container disappeared. Ok, that's weird. Why did that happen. That actually happened, because it collapsed down to have no height at all. So the thing about floats is they don't occupy ...

Float containment
Video duration: 6m 35s 6h 8m Intermediate

Viewers:

Float containment provides you with in-depth training on Web. Taught by Eric Meyer as part of the CSS Web Site Design

Subject:
Web
Software:
CSS
Author:
please wait ...