Give the element display: inline; after setting display: inline-block; in IE6 and IE7. You can do this using conditional comments or by using the following code:
div#foo {
display: inline-block;
}
* html div#foo { /* for IE6 */
display: inline;
}
*+html div#foo { /* for IE7 */
display: inline;
}