IE6 CSS display:table fix?

后端 未结 2 402
清酒与你
清酒与你 2021-01-29 04:44


I\'m working on a web app... unfortunately it has to work with the worst piece of software ever written, yes ie6.

I really like the CSS display:table a

2条回答
  •  走了就别回头了
    2021-01-29 05:14

    IE does not support display:table and display:table-cell but IE7 and below do support display:inline-block. The common way to make this work is by doing the following:

    display:-moz-inline-stack;
    display:inline-block;
    zoom:1;
    *display:inline;
    

    Keep in mind that CSS gives you a lot of positioning power and given some context of how you want your layout to look I might be able to give you a better solution.

    Due to misunderstanding let me clarify the code above. display:-moz-inline-stack; is declared for older versions of Firefox. zoom:1; IE has a property called hasLayout, this is a way to trigger it. *display:inline is known as a *property hack used to hide this line from all non-IE browsers

    The zoom:1 and *display:inline effectively allow block level elements to behave like inline elements (so that inline-block will work in IE6+)

    For more information please read:

    1. http://blog.mozilla.com/webdev/2009/02/20/cross-browser-inline-block/
    2. http://foohack.com/2007/11/cross-browser-support-for-inline-block-styling/

提交回复
热议问题