Use CSS :after to Clear Floats

3/3/2013 12:44:09 AM

Use the following CSS to clear floats. This allows you to remove additional "clearing" markup (ex: <div class="clear"></div>").

div.parentOfThreeColumns:after
{
	content: ".";
	display: block;
	height: 0;
	clear: both;
	visibility: hidden;
}

/*  alternate versions   */

div.parentOfThreeColumns:after
{
	content: " ";
	display: block;
	height: 0;
	clear: both;
	visibility: hidden;
}

div.parentOfThreeColumns:after
{
	content: "";
	display: block;
	height: 0;
	clear: both;
	visibility: hidden;
}