<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>MikePadgett.com &#187; clearfix</title>
	<atom:link href="http://www.mikepadgett.com/tag/clearfix/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mikepadgett.com</link>
	<description>Articles, reviews, travel, design, literature and more written by Mike Padgett, an Information Designer in Brussels</description>
	<lastBuildDate>Thu, 02 Feb 2012 09:02:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Solution to nested DIV float problems</title>
		<link>http://www.mikepadgett.com/technology/technical/solution-to-nested-div-float-problems/</link>
		<comments>http://www.mikepadgett.com/technology/technical/solution-to-nested-div-float-problems/#comments</comments>
		<pubDate>Mon, 12 Sep 2005 09:51:35 +0000</pubDate>
		<dc:creator>Mike Padgett</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[clearfix]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[div]]></category>
		<category><![CDATA[float]]></category>
		<category><![CDATA[hack]]></category>

		<guid isPermaLink="false">http://localhost/?p=194</guid>
		<description><![CDATA[A CSS hack for nested divs that break out of their container.]]></description>
			<content:encoded><![CDATA[<p class="note">This item is now out of date. See the <a href="/technology/technical/alternative-to-the-pie-clearfix-hack/">updated version</a>.</p>
<p>I recently discovered a CSS hack that has come in very handy indeed since.</p>
<p>The problem arises in both Firefox and IE (though the solution is different for each) when we try to wrap a div around one or more divs with float.</p>
<p style="text-align: center"><img src="/legacy/images/client_images/float_problem.gif" alt="Nested floated div breaks wrapper!" width="412" height="300" /></p>
<p>You want your wrapper to stretch vertically with your contained divs, but instead, you find that your wrapper gets behind when your floated content divs go stretching off down the viewport and beyond.</p>
<p>The development community is all but silent on this issue, though I would think it&#8217;s a common enough problem to have encountered.</p>
<p>I tried and tested an IE solution, but it was thanks to Big John and Holly at <a href="http://www.positioniseverything.net/">positioniseverything</a> that the NS / Firefox side of things could be cleared up. The full article with the whys and wherefores is <a href="http://www.positioniseverything.net/easyclearing.html" target="_blank">here</a>, and the code we need is as follows:</p>
<p><code> .clearfix:after {content: "."; display: block; height: 0; clear: both; visibility: hidden;}<br />
.clearfix {display: inline-table;}<br />
/* Hides from IE-mac \*/<br />
* html .clearfix {height: 1%;}<br />
.clearfix {display: block;}<br />
/* End hide from IE-mac */<br />
</code></p>
<p>Now we get the result we want!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mikepadgett.com/technology/technical/solution-to-nested-div-float-problems/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

