The Coast is Clear

A notebook entry published on April 1, 2004

11:43 AM

Not long after I updated my CSS, a reader pointed out that when resizing text, the content column would “jump” to the right, overlapping the sidebar. Not good.

The problem: I needed to clear the floats that enable the navigation to be horizontal. This didn’t seem to be a problem in my old, positioned layout. But when floats are used to lay out the columns that follow the navigation, not clearing can cause bizarre issues.

The solution: Adding a simple clear: left; to the #content declaration (since this <div> follows the navigation) solved the text resizing issue.

Something to keep in mind if you’re using a floating layout, along with an unordered navigation list that also uses float.

So… clear, clear, clear.

Also see Containing Floats from Eric Meyer for more ways to… you guessed it, contain floats.

Tags

CSS


Ad via The Deck

Authentic Jobs

Come on in, we're hiring



A tiny design studio founded by Dan Cederholm. We create simple interfaces balanced with a standards-based methodology, and we’re based in Massachusetts, USA.

Elsewhere