<?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>Web Standards Tips &#187; browser</title>
	<atom:link href="http://webstandardstips.com/tag/browser/feed/" rel="self" type="application/rss+xml" />
	<link>http://webstandardstips.com</link>
	<description>Practical advice for building websites with web standards</description>
	<lastBuildDate>Mon, 08 Mar 2010 13:39:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Easy clearing of floats</title>
		<link>http://webstandardstips.com/2008/11/18/easy-clearing-of-floats/</link>
		<comments>http://webstandardstips.com/2008/11/18/easy-clearing-of-floats/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 16:01:42 +0000</pubDate>
		<dc:creator>Isofarro</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[agrade]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[clear]]></category>
		<category><![CDATA[content:after]]></category>
		<category><![CDATA[easyclearing]]></category>
		<category><![CDATA[float]]></category>
		<category><![CDATA[graded]]></category>
		<category><![CDATA[hasLayout]]></category>
		<category><![CDATA[layout]]></category>
		<category><![CDATA[selfclear]]></category>
		<category><![CDATA[support]]></category>

		<guid isPermaLink="false">http://www.webstandardstips.com/?p=3</guid>
		<description><![CDATA[One of the main methods of creating stable layouts is to ensure that elements that contain floated elements clear these floats. Given an element with an id of wrapper, the styles needed to easy clear any contained floats is: #wrapper:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } #wrapper { zoom: [...]]]></description>
			<content:encoded><![CDATA[<p>One of the main methods of creating stable layouts is to ensure that elements that contain floated elements clear these floats.</p>
<p>Given an element with an id of wrapper, the styles needed to easy clear any contained floats is:</p>
<pre>
<code>
#wrapper:after {
	content: ".";
	display: block;
	height: 0;
	clear: both;
	visibility: hidden;
}
#wrapper {
	zoom: 1;
}
</code>
</pre>
<p>The <code>:after</code> selector deals with most modern browsers, so Firefox, Safari, Opera (the ones listed as Grade A browsers in Yahoo!&#8217;s <a href="http://developer.yahoo.com/yui/articles/gbs/#gbschart">Graded Browser Support</a> chart). Internet Explorer 6 and 7 ignore this rule, so the second stylerule, the <code>zoom: 1</code> triggers <code>hasLayout</code> in IE6 and 7 which does the self-clearing of floats.</p>
<p>If valid CSS is an absolute and non-negotiable requirement, then <code>zoom: 1</code> is going to be a problem. So instead you could replace the <code>zoom:1</code> selector rule with another style-rule that triggers hasLayout in IE, like <code>height: 0%</code>, or <code>overflow: hidden</code> &#8211; pick your poison.</p>
]]></content:encoded>
			<wfw:commentRss>http://webstandardstips.com/2008/11/18/easy-clearing-of-floats/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

