Skip to content

Instantly share code, notes, and snippets.

@rodi01
Created February 1, 2012 06:00
Show Gist options
  • Save rodi01/1715395 to your computer and use it in GitHub Desktop.
Save rodi01/1715395 to your computer and use it in GitHub Desktop.
Renaming and Extending Easy-Clearing, AKA Clearfix
.group:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
.groupList > li,
.group:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
/* IE6 */
* html .groupList li,
* html .group { height: 1%; }
* html .groupList li li { height: auto; } /* Resets nested LIs */
/*IE7 */
.group > li,
.group { min-height: 1px; }
<ul class="comments">
<li class="group">
<img src="carla.jpg" alt="Carla&#x27;s Picture" />
<p>Tiny and I miss you</p>
</li>
<li class="group">
<img src="steven.jpg" alt="Steven&#x27;s Picture" />
<p>I need a favor! It will take you 5 seconds.</p>
</li>
<li class="group">
<img src="buzz.jpg" alt="Buzz&#x27;s Picture" />
<p>I speak gibberish</p>
</li>
</ul>
<ul class="comments groupList">
<li>
<img src="carla.jpg" alt="Carla&#x27;s Picture" />
<p>Tiny and I miss you</p>
</li>
<li>
<img src="steven.jpg" alt="Steven&#x27;s Picture" />
<p>I need a favor! It will take you 5 seconds.</p>
</li>
<li>
<img src="buzz.jpg" alt="Buzz&#x27;s Picture" />
<p>I speak gibberish</p>
</li>
</ul>
/* IE6 */
* html .group { height: 1%; }
/*IE7 */
.group { min-height: 1px; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment