Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 4. Creative Floating > Choosing what works for you

Choosing what works for you

Now that we’ve looked at three methods for self-clearing, I’d like to point out that (as with almost everything in web design) there’s no one way that is correct 100% of the time. After experimenting with them all, you’ll find that one method might work better than the others for you, depending on the situation.

I like the easy clearing method because of its robustness in just about any scenario, but I’ll often throw overflow: hidden; on a container when initially building a layout, which is quick and easy to remember while prototyping. Later, I’ll do a quick search for that rule and build the three declarations that make up the easy clearing method.

Whatever method you choose, the important thing to remember is that self-clearing can be a powerful tool that maintains the flexibility that floats can bring to layout while keeping components of the page independent.

  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint