Skip to content

Instantly share code, notes, and snippets.

@tspringborg
Created July 30, 2013 10:47
Show Gist options
  • Save tspringborg/6111958 to your computer and use it in GitHub Desktop.
Save tspringborg/6111958 to your computer and use it in GitHub Desktop.
Although elements like <div>s normally grow to fit their contents, using the float property can cause a startling problem for CSS newbies: if floated elements have non-floated parent elements, the parent will collapse.
.content:after{
content: " ";
display: block;
height: 0;
clear: both;
*zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML += '<div class="ie7-clear"></div>' );
}
.ie7-clear {
display: block;
clear: both;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment