I am available for freelance work! Click here to email me.

Self Clearing Floats in CSS

Saturday, November 15th, 2008

This is a quickie mainly to remind myself. My friend and fellow Fudge developer, Mike “1312” Byrne showed me a CSS trick to have divs clear themselves.
div#container
{
height: 1%;
}

div#container:after
{
content: “.”;
display: block;
height: 0;
clear: both;
visibility: hidden;
}
Brilliant. This works in Safari, Firefox and IE6+ as far as I know.

Posted in CSS | Tags: , | Comments

Purify - Issue Tracker

Jim Neath is a 26 year old Freelance Ruby on Rails developer from Manchester, UK.

Recommend Me

Categories