Tuesday, January 13, 2009

display:inline-block for Firefox, Internet Explorer and Opera

For correct displaying of the elements with display:inline-block property in Firefox Internet Explorer, Opera you have to write this in style sheet:

display:-moz-inline-stack;/*Firefox need this to simulate display:inline-block*/

display:inline-block; /*IE does not apply this to Block Element, and Firefox does not render this, too*/

_overflow:hidden;/*fix IE6 to expanded content*/
zoom:1;/*trigger hasLayout*/
*display:inline;/*once hasLayout is true, set display:inline to block element will make display:inline behave like display:inline-block*

1 comment:

Tim said...

Worked Great, thanks!