Syndicate content

css

Sep 21
0

elegant fix for heightless container div that has only floated elements in it

Mon, 09/21/2009 - 11:46 — peter

The Problem

if a container div only contains floated divs, that container div has no height. the usual fix is to add an extra markup on the code with a clear: both (or left/right) style. but that is putting layout on the markup, which makes you go to css hell without 72 div virgins waiting for you.