IE7 and the CSS table-cell property

前端 未结 10 1822
名媛妹妹
名媛妹妹 2020-11-29 20:17

So I just love it when my application is working great in Firefox, but then I open it in IE and... Nope, please try again.

The issue I\'m having is that I\'m setting

10条回答
  •  旧巷少年郎
    2020-11-29 20:59

    Using inline-block works well for this type of stuff. No, IE 6 and IE 7 technically do not have display: inline-block, but you can replicate the behavior with the following styles:

    div.show-ib {
        display: inline-block;
        *zoom: 1;
        *display: inline;
    }
    

    The key to this is 'zoom: 1' toggles the 'hasLayout' property on the element which changes the way the browser renders a block level element. The only gotcha with inline block is you cannot have a margin of less than 4px.

提交回复
热议问题