<?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>Oncemade &#187; easy-clearing</title>
	<atom:link href="http://oncemade.com/tag/easy-clearing/feed/" rel="self" type="application/rss+xml" />
	<link>http://oncemade.com</link>
	<description>Design, Web Dev, Inspiration</description>
	<lastBuildDate>Fri, 09 Jul 2010 02:06:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Renaming and Extending Easy-Clearing, AKA Clearfix</title>
		<link>http://oncemade.com/renaming-and-extending-easy-clearing-aka-clearfix/</link>
		<comments>http://oncemade.com/renaming-and-extending-easy-clearing-aka-clearfix/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 04:25:28 +0000</pubDate>
		<dc:creator>Rodrigo</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[clearfix]]></category>
		<category><![CDATA[easy-clearing]]></category>
		<category><![CDATA[group]]></category>
		<category><![CDATA[Markup]]></category>

		<guid isPermaLink="false">http://oncemade.com/?p=642</guid>
		<description><![CDATA[When positioniseverything.net posted an article about clearfix technique, it didn&#x27;t take much for web developers and designers to start adopting [...]]]></description>
			<content:encoded><![CDATA[<p>When <a href="http://positioniseverything.net">positioniseverything.net</a> posted an article about <a href="http://www.positioniseverything.net/easyclearing.html"><em>clearfix</em></a> technique, it didn&#x27;t take much for web developers and designers to start adopting it. Lately, <a href="http://simplebits.com">Dan Cederholm</a> has been talking about renaming the class <em>clearfix</em> to <em>group</em>, which semantically speaking makes a lot more sense. So, let&#x27;s go ahead and rename the class.</p>
<pre><h4>New Easy-Clearing</h4><code>.group:after {
  content: ".";
  display: block;
  height: 0;
  clear: both;
  visibility: hidden;
}</code></pre>

<p>Using <a href="http://www.quirksmode.org/css/condcom.html">conditional comments</a>, let&#x27;s add the proper code to handle <abbr title="Internet Explore 6">IE 6</abbr> and <abbr title="Internet Explore 7">IE 7</abbr> (<abbr title="Internet Explore 8">IE8</abbr> supports the :after pseudo-elements; no extra code is necessary).</p>
<span id="more-642"></span>
<pre><h4>New Easy-Clearing for IE</h4><code>/* IE6 */
* html .group { height: 1%; }

/*IE7 */
.group { min-height: 1px; }</code></pre>
<p>I&#x27;ve been using the <em>group</em> class on my latest projects and I&#x27;d like to share a small tip, when clearing list items, with you.</p>
<p>Normally, we&#x27;d have the <em>group</em> class on every <em>LI</em>, like so:</p>
<pre><h4>Clearing List Items the Old Way</h4><code>&lt;ul class=&quot;comments&quot;&gt;
  &lt;li class=&quot;group&quot;&gt;
    &lt;img src=&quot;carla.jpg&quot; alt=&quot;Carla&amp;#x27;s Picture&quot; /&gt;
    &lt;p&gt;Tiny and I miss you&lt;/p&gt;
  &lt;/li&gt;
  &lt;li class=&quot;group&quot;&gt;
    &lt;img src=&quot;steven.jpg&quot; alt=&quot;Steven&amp;#x27;s Picture&quot; /&gt;
    &lt;p&gt;I need a favor! It will take you 5 seconds.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li class=&quot;group&quot;&gt;
    &lt;img src=&quot;buzz.jpg&quot; alt=&quot;Buzz&amp;#x27;s Picture&quot; /&gt;
    &lt;p&gt;I speak gibberish&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;</code></pre>


<!--more-->
<p>Although the markup doesn&#x27;t look very bad, we can make things better by introducing a new class (<em>groupList</em>) and adding it to the <em>UL</em>.</p>
<pre><h4>Clearing List Items the New Way</h4><code>&lt;ul class=&quot;comments groupList&quot;&gt;
  &lt;li&gt;
    &lt;img src=&quot;carla.jpg&quot; alt=&quot;Carla&amp;#x27;s Picture&quot; /&gt;
    &lt;p&gt;Tiny and I miss you&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;img src=&quot;steven.jpg&quot; alt=&quot;Steven&amp;#x27;s Picture&quot; /&gt;
    &lt;p&gt;I need a favor! It will take you 5 seconds.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;img src=&quot;buzz.jpg&quot; alt=&quot;Buzz&amp;#x27;s Picture&quot; /&gt;
    &lt;p&gt;I speak gibberish&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;</code></pre>

<p>Phew, the markup looks much cleaner! Now that we&#x27;ve fixed it, let&#x27;s add the <em>.groupList > li</em> selector to the existing <em>.group</em> styles.</p>
<pre><h4>Extending .group</h4><code>.groupList > li,
.group:after {
  content: ".";
  display: block;
  height: 0;
  clear: both;
  visibility: hidden;
}</code></pre>

<p>Wait! How about the beloved <abbr title="Internet Explore">IE</abbr>?

<pre><h4>Extending .group IE</h4><code>/* IE6 */
* html .groupList li,
* html .group { height: 1%; }
* html .groupList li li { height: auto; } /* Resets nested LIs */

/*IE7 */
.group > li,
.group { min-height: 1px; }</code></pre>


<p>
<h4>Browser Support</h4>
<ul class  = "browserComp clearfix">
<li class = "firefoxComp"><span>Firefox</span></li>
<li class = "safariComp"><span>Safari</span></li>
<li class = "chromeComp"><span>Chrome</span></li>
<li class = "operaComp"><span>Opera</span></li>
<li class = "ie7Comp"><span>Internet Explore 7 &#038; 8</span></li>
<li class = "ie6Comp"><span>Internet Explore 6</span></li>
</ul>
</p>]]></content:encoded>
			<wfw:commentRss>http://oncemade.com/renaming-and-extending-easy-clearing-aka-clearfix/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>
