开发者

For IE8 - Trying to set cell spacing/padding to 0px in combination with CSS display's table_cell

开发者 https://www.devze.com 2023-02-19 20:33 出处:网络
I tried to vertically align some content into div box. to achieve this I have found some CSS that works perfect. Except for you know wh开发者_StackOverflow中文版o it doen\'t: IE8. When using the displ

I tried to vertically align some content into div box. to achieve this I have found some CSS that works perfect. Except for you know wh开发者_StackOverflow中文版o it doen't: IE8. When using the display attribute with the value 'table-cell', IE is creating an invisible cellpadding/cellspacing.

.item_box{
        display: table-cell;
        padding:0px;
        margin:0px;
        width:160px;
        height:160px;
        text-align: center;
        vertical-align:middle;
    }  

the two lines 'padding' and 'margin' do affect only FF, Chrome, Opera. I need it to be '0' padding/spacing to preserve the main layout. Any clue how to solve this for IE?

thanks a lot


Regarding your "invisible cellpadding/cellspacing", try experimenting with "border-collapse:collapse;" on your surrounding "display:table" container css.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号