Clear floats without structural markup (CSS)

October 14, 2007 at 5:37 pm Leave a comment

“.clearfix” is the container that holds all of your floated elements. Works in all browsers that support “float” and “clear”.

clearfix
{
display: inline-table;
/* Hides from IE-mac \*/
height: 1%;
display: block;
/* End hide from IE-mac */
}

html>body .clearfix
{
height: auto;
}
.clearfix:after
{
content: “.”;
display: block;
height: 0;
clear: both;
visibility: hidden;
}

Entry filed under: css.

some more tech links min-height for IE (and all other browsers)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed


Flickr Photos

Top Clicks

  • None

Blog Stats

  • 730,517 hits

%d bloggers like this: