<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Clear Your Floats - The Right Way</title>
	<atom:link href="http://dtott.com/thoughts/2007/12/10/clear-your-floats-the-right-way/feed/" rel="self" type="application/rss+xml" />
	<link>http://dtott.com/thoughts/2007/12/10/clear-your-floats-the-right-way/</link>
	<description></description>
	<pubDate>Thu, 24 Jul 2008 10:11:48 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: Zed</title>
		<link>http://dtott.com/thoughts/2007/12/10/clear-your-floats-the-right-way/#comment-178</link>
		<dc:creator>Zed</dc:creator>
		<pubDate>Thu, 24 Jul 2008 02:29:09 +0000</pubDate>
		<guid isPermaLink="false">http://dtott.com/thoughts/2007/12/10/clear-your-floats-the-right-way/#comment-178</guid>
		<description>#container {
overflow: auto;
}
* html #container {
height: 1%; }

And how do you remove/hide the scrollbar that is displayed from de overflow:auto?</description>
		<content:encoded><![CDATA[<p>#container {<br />
overflow: auto;<br />
}<br />
* html #container {<br />
height: 1%; }</p>
<p>And how do you remove/hide the scrollbar that is displayed from de&nbsp;overflow:auto?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andreas Lagerkvist</title>
		<link>http://dtott.com/thoughts/2007/12/10/clear-your-floats-the-right-way/#comment-157</link>
		<dc:creator>Andreas Lagerkvist</dc:creator>
		<pubDate>Sat, 12 Apr 2008 13:43:20 +0000</pubDate>
		<guid isPermaLink="false">http://dtott.com/thoughts/2007/12/10/clear-your-floats-the-right-way/#comment-157</guid>
		<description>I've used easy clear for as long as i can remember but the overflow-one seems fine as well. I remember hearing it doesn't always work in IE though?

I agree that you shouldn't add .clearfix-classes all over the place as they are completely design-related. I use &lt;a href="http://exscale.se/archives/2008/01/15/css-constants-and-compression-php-class/" rel="nofollow"&gt;my css-constants&lt;/a&gt; to avoid having to use a class but still be able to structure my CSS any way i want:

#navigation ul = $self-clear;

other code

#wrapper = $self-clear;

etc...</description>
		<content:encoded><![CDATA[<p>I&#8217;ve used easy clear for as long as i can remember but the overflow-one seems fine as well. I remember hearing it doesn&#8217;t always work in IE though?</p>
<p>I agree that you shouldn&#8217;t add .clearfix-classes all over the place as they are completely design-related. I use <a href="http://exscale.se/archives/2008/01/15/css-constants-and-compression-php-class/" rel="nofollow">my css-constants</a> to avoid having to use a class but still be able to structure my CSS any way i want:</p>
<p>#navigation ul = $self-clear;</p>
<p>other code</p>
<p>#wrapper = $self-clear;&nbsp;etc&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nacho</title>
		<link>http://dtott.com/thoughts/2007/12/10/clear-your-floats-the-right-way/#comment-156</link>
		<dc:creator>Nacho</dc:creator>
		<pubDate>Fri, 11 Apr 2008 13:28:27 +0000</pubDate>
		<guid isPermaLink="false">http://dtott.com/thoughts/2007/12/10/clear-your-floats-the-right-way/#comment-156</guid>
		<description>Great help. I used empty divs. But not anymore.
Thank you :]</description>
		<content:encoded><![CDATA[<p>Great help. I used empty divs. But not anymore.<br />
Thank you&nbsp;:]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve</title>
		<link>http://dtott.com/thoughts/2007/12/10/clear-your-floats-the-right-way/#comment-114</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Fri, 25 Jan 2008 02:58:05 +0000</pubDate>
		<guid isPermaLink="false">http://dtott.com/thoughts/2007/12/10/clear-your-floats-the-right-way/#comment-114</guid>
		<description>I use this method to clear my floats all the time.  To me, it's the best solution out there.  Thanks for posting this.  Cheers. =)</description>
		<content:encoded><![CDATA[<p>I use this method to clear my floats all the time.  To me, it&#8217;s the best solution out there.  Thanks for posting this.  Cheers.&nbsp;=)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Terrence Wood</title>
		<link>http://dtott.com/thoughts/2007/12/10/clear-your-floats-the-right-way/#comment-100</link>
		<dc:creator>Terrence Wood</dc:creator>
		<pubDate>Wed, 12 Dec 2007 20:57:34 +0000</pubDate>
		<guid isPermaLink="false">http://dtott.com/thoughts/2007/12/10/clear-your-floats-the-right-way/#comment-100</guid>
		<description>overflow:hidden is the better option for containing floats, it prevents FireFox from giving the clearing element focus when tabbing through a page and prevents scrollbars appearing where the clearing element shrinkwraps an anchor. Again, you must ensure that the containing element hasLayout for it to work in IE6. hasLayout is triggered by setting an explicit width amongst other things.

@Mohamed Jama, one situation where you wouldn't want to use float to clear other floats is when you want to add margin: auto to the container.</description>
		<content:encoded><![CDATA[<p>overflow:hidden is the better option for containing floats, it prevents FireFox from giving the clearing element focus when tabbing through a page and prevents scrollbars appearing where the clearing element shrinkwraps an anchor. Again, you must ensure that the containing element hasLayout for it to work in IE6. hasLayout is triggered by setting an explicit width amongst other things.</p>
<p>@Mohamed Jama, one situation where you wouldn&#8217;t want to use float to clear other floats is when you want to add margin: auto to the&nbsp;container.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Will Wilkins</title>
		<link>http://dtott.com/thoughts/2007/12/10/clear-your-floats-the-right-way/#comment-99</link>
		<dc:creator>Will Wilkins</dc:creator>
		<pubDate>Tue, 11 Dec 2007 18:14:19 +0000</pubDate>
		<guid isPermaLink="false">http://dtott.com/thoughts/2007/12/10/clear-your-floats-the-right-way/#comment-99</guid>
		<description>Hi Dan, Interesting method.  However, the last method shown by Mohamed should work fine as well.  However, the width of the container would have to be set to span the page as it did before the float.  But Mohamed could have kept the styling within the #container div and he set both of the 'float' containers to the same width.</description>
		<content:encoded><![CDATA[<p>Hi Dan, Interesting method.  However, the last method shown by Mohamed should work fine as well.  However, the width of the container would have to be set to span the page as it did before the float.  But Mohamed could have kept the styling within the #container div and he set both of the &#8216;float&#8217; containers to the same&nbsp;width.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan</title>
		<link>http://dtott.com/thoughts/2007/12/10/clear-your-floats-the-right-way/#comment-98</link>
		<dc:creator>Dan</dc:creator>
		<pubDate>Tue, 11 Dec 2007 17:11:24 +0000</pubDate>
		<guid isPermaLink="false">http://dtott.com/thoughts/2007/12/10/clear-your-floats-the-right-way/#comment-98</guid>
		<description>Dave - 

You're right; they're both valid solutions to the same problem.  It's a win either way, since you're removing the need for non-semantic content like empty divs.

Also, you get points in my book for using "whilst" (:</description>
		<content:encoded><![CDATA[<p>Dave - </p>
<p>You&#8217;re right; they&#8217;re both valid solutions to the same problem.  It&#8217;s a win either way, since you&#8217;re removing the need for non-semantic content like empty divs.</p>
<p>Also, you get points in my book for using &#8220;whilst&#8221;&nbsp;(:</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mohamed Jama</title>
		<link>http://dtott.com/thoughts/2007/12/10/clear-your-floats-the-right-way/#comment-96</link>
		<dc:creator>Mohamed Jama</dc:creator>
		<pubDate>Tue, 11 Dec 2007 16:24:09 +0000</pubDate>
		<guid isPermaLink="false">http://dtott.com/thoughts/2007/12/10/clear-your-floats-the-right-way/#comment-96</guid>
		<description>Hey Dave,

Yeah it might include a little more CSS but then again you don't actually need to apply width to the parent DIV and yeah you are correct you have to float all elements within that parent. It worked for and is tuck with it to be honest, I will give the easyclear a chance as soon as i can though</description>
		<content:encoded><![CDATA[<p>Hey Dave,</p>
<p>Yeah it might include a little more CSS but then again you don&#8217;t actually need to apply width to the parent DIV and yeah you are correct you have to float all elements within that parent. It worked for and is tuck with it to be honest, I will give the easyclear a chance as soon as i can&nbsp;though</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Woods</title>
		<link>http://dtott.com/thoughts/2007/12/10/clear-your-floats-the-right-way/#comment-95</link>
		<dc:creator>Dave Woods</dc:creator>
		<pubDate>Tue, 11 Dec 2007 16:18:51 +0000</pubDate>
		<guid isPermaLink="false">http://dtott.com/thoughts/2007/12/10/clear-your-floats-the-right-way/#comment-95</guid>
		<description>Hi Dan, 

I think Mohamed was talking about floating the parent container and applying a width so that it would stretch to contain its children. Whilst that method works, sometimes it can cause issues especially when dealing with fluid layouts where a percentage is required so I would suggest clearing where possible otherwise you'll end up needing to float all elements which can lead to a lot of extra CSS.

I can't think of any situation where the overflow method would be cumbersome? All the overflow: auto; method does is remind the parent that it should be set to auto anyway and forces it to contain its children. If you needed to use overflow for another purpose then you should find that overflow: hidden or scroll; work just as well ;)

Thanks
Dave</description>
		<content:encoded><![CDATA[<p>Hi Dan, </p>
<p>I think Mohamed was talking about floating the parent container and applying a width so that it would stretch to contain its children. Whilst that method works, sometimes it can cause issues especially when dealing with fluid layouts where a percentage is required so I would suggest clearing where possible otherwise you&#8217;ll end up needing to float all elements which can lead to a lot of extra CSS.</p>
<p>I can&#8217;t think of any situation where the overflow method would be cumbersome? All the overflow: auto; method does is remind the parent that it should be set to auto anyway and forces it to contain its children. If you needed to use overflow for another purpose then you should find that overflow: hidden or scroll; work just as well ;)</p>
<p>Thanks&nbsp;Dave</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mohamed Jama</title>
		<link>http://dtott.com/thoughts/2007/12/10/clear-your-floats-the-right-way/#comment-94</link>
		<dc:creator>Mohamed Jama</dc:creator>
		<pubDate>Tue, 11 Dec 2007 16:12:40 +0000</pubDate>
		<guid isPermaLink="false">http://dtott.com/thoughts/2007/12/10/clear-your-floats-the-right-way/#comment-94</guid>
		<description>hey Dan,

try this

#container{ background: #79aff2; padding: 10px; border:1px solid #1b5fab;float:left;}
#container #float1{ float:left; background: #eddd94; padding: 5px; border:1px solid #333; margin: 5px; width:300px;}
#container #float2{ float:left; background: #eddd94; padding: 5px; border:1px solid #333; margin: 5px; width:300px;;}

it works fine without setting the height, this is just my opinion though Dan :D</description>
		<content:encoded><![CDATA[<p>hey Dan,</p>
<p>try this</p>
<p>#container{ background: #79aff2; padding: 10px; border:1px solid #1b5fab;float:left;}<br />
#container #float1{ float:left; background: #eddd94; padding: 5px; border:1px solid #333; margin: 5px; width:300px;}<br />
#container #float2{ float:left; background: #eddd94; padding: 5px; border:1px solid #333; margin: 5px; width:300px;;}</p>
<p>it works fine without setting the height, this is just my opinion though Dan&nbsp;:D</p>
]]></content:encoded>
	</item>
</channel>
</rss>
