For IE8 - Trying to set cell spacing/padding to 0px in combination with CSS display's table_cell
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 lotRegarding your "invisible cellpadding/cellspacing", try experimenting with "border-collapse:collapse;" on your surrounding "display:table" container css.
精彩评论