Hi,
IE7 needs display block as well. Normally they would just over right each other. But not when it comes to "haslayout". IE gets layout from display inline-block and then that gets overridden by display block but IE keeps "haslyout". It's called the
trip switch. But the two rules also have to be separated by another in order to work. So basically, the only things you can safely eliminate are the mac hack comments if you don't care about IE5 Mac.
So this is how it should and needs to look.
.clearfix:after {
content:" ";
display:block;
height:0;
font-size:0;
clear:both;
visibility:hidden;
}
.clearfix {display:inline-block;}
/* mac hide \*/
* html .clearfix {height:1%;}
.clearfix {display:block;}
/* End hide */
Or if you don't care about IE5 Mac then it would look like this.
.clearfix:after {
content:" ";
display:block;
height:0;
font-size:0;
clear:both;
visibility:hidden;
}
.clearfix {display:inline-block;}
* html .clearfix {height:1%;}
.clearfix {display:block;}
Alternatively you can code it with CC's instead like this
.clearfix:after {
content:" ";
display:block;
height:0;
font-size:0;
clear:both;
visibility:hidden;
}
.clearfix {display: inline-block;} /* for IE5/Mac and IE7 */
<!--[if IE]>
<style type="text/css">
.clearfix {
zoom: 1; /* triggers hasLayout */
display: block; /* resets display for IE/Win */
}
</style>
<![endif]-->
Or if you don't care about IE5 Mac then it would look like this.
.clearfix:after {
content:" ";
display:block;
height:0;
font-size:0;
clear:both;
visibility:hidden;
}
<!--[if IE]>
<style type="text/css">
.clearfix {
zoom: 1; /* triggers hasLayout */
}
</style>
<![endif]-->
Bookmarks