
Originally Posted by
ralph.m
Inline-block is fantastic, and better than float in a lot of respects. I use it a lot now, and this will work fine in any page environment, really. IE7 and under don't recognize it, though, but you can fix that by giving them display: inline instead.
Code:
.box {
display: inline; /* for sucky old IE */
display:inline-block;
vertical-align: top;
}
Hey Ralph you need to give the inline rule in a separate rule otherwise IE7 and under just get inline-block which does nothing more than apply haslayout to block elements.
You need to do this:
Code:
.box {
display:inline-block;
vertical-align: top;
}
* html .box{ display: inline; /* for sucky old IE6 */}
*+html .box{ display: inline; /* for sucky old IE7 */}
Or if you don't mind proprietary css and an invalid hack then do this:
Code:
.box {
display:inline-block;
vertical-align: top;
*display:inline;/* for sucky old IE6 and 7 */
zoom:1.0;/* for sucky old IE6 and 7 */
}
IE7 and 6 natively understand inline-block on inline elements so no special rules are needed but for block elements you need to set them to inline and then give them haslayout and then they will behave as inline-block.
Bookmarks