我有一個TD內的div,我似乎無法刪除它周圍的1px邊框。 如果我嘗試添加td {padding:0}
,邊框消失,但div跳到左側,變量td自動變爲0px寬度。 我怎樣才能刪除邊框周圍的邊框而不搞亂整個桌子?td內的Div具有1 px邊框。它如何被刪除?
HTML:
<table>
<tr>
<td class="header-left"></td>
<td class="header">
<div class="header-image"></div>
</td>
<td class="header-right"></td>
</tr>
</table>
CSS:
table {
width:100%;
border-spacing: 0;
}
.header-left {
height:100px;
background-image:url(img/header-left.png);
background-repeat:repeat-x;
}
.header-right {
height:100px;
background-image:url(img/header.png);
background-repeat:repeat-x;
}
.header {
height:100px;
width:960px;
background-image:url(img/header.png);
background-repeat:repeat-x;
margin:0 auto;
}
.header-image {
height:100px;
width:548px;
background-repeat:no-repeat;
background-image:url(img/header-image.png);
}
你能分享一個小提琴的例子嗎? – Pandian 2013-02-25 15:52:08