Blogless: Blog of Design Less Better.

Posts tagged CSS Tricks.

My Favorite CSS Trick

Have you ever wanted to clear a floated HTML element without the need for messy and unsemantic structural markup? Well, if you have, and you haven't already heard the good news, I've got a technique that's going to make you jump for joy.

On this fine July morning, like to just take a moment of your time to eulogize what is, as far as I'm concerned, the most useful CSS trick I've ever run across. I've used this about five hundred times in my life, and I wanted to take the opportunity to address it to you, good reader, as if by some chance you haven't yet run into it.

I've chosen this opportunity, partially, because trend leader 37signals announced last week that they're dropping support for IE6 in their products. Which, in my immediate (albeit short-lived) joy, caused me to imagine a world where we could all stop supporting IE<=6, and, subsequently, in which this trick would become even more elegant and universal.

This trick was introduced to us all under the sign of How To Clear Floats Without Structural Markup. It is a trick developed by Tony Aslett and published at Position is Everything.

It makes it possible to clear floats without any unnecessary, unsemantic or hacky structural markup.

These icons link to social bookmarking sites where readers can share and discover new web pages.
PaulJul 9, 2008