Skip to content

Instantly share code, notes, and snippets.

@maxhoffmann
Created February 4, 2013 14:22
Show Gist options
  • Select an option

  • Save maxhoffmann/4706966 to your computer and use it in GitHub Desktop.

Select an option

Save maxhoffmann/4706966 to your computer and use it in GitHub Desktop.
Micro Clearfix IE8+
/**
* Micro Clearfix IE8+
*/
.bg {
background: red;
}
.cf:after{
content: "";
display: table;
clear: both;
}
.cf2 {
overflow: auto;
}
.left {
float: left;
height: 100px;
}
.right {
float: right;
height: 100px;
}
html {
font-family: sans-serif;
}
<h2>After</h2>
<div class="bg cf">
<div class="left"></div>
<div class="right"></div>
</div>
<h2>Overflow</h2>
<div class="bg cf2">
<div class="left"></div>
<div class="right"></div>
</div>
// alert('Hello world!');
{"view":"separate","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment