两个td或tr标签之间的空格

时间:2014-04-21 09:46:16

标签: html css

我希望你帮我解决一些非常困扰我的事情。 我有这个css和HTML代码:

body
{
background-color:#ffffff;
margin-top:0;
margin-bottom:0;
margin-left:0;
margin-right:0;
padding-top:0px;
}
table.main-table-default
{
margin:0px auto 0px auto;
background-color:#00ffff;
width:700px;
border-collapse:collapse;
padding:0px;
border-spacing:0px 0px;
text-align:center;
vertical-align:top;
}
table.main-table-default td
{
border-collapse:collapse;
padding:0px 0px 0px 0px;
text-align:center;
vertical-align:top;
}
table.main-table-header-default
{
margin:0px auto 0px auto;
background-color:#000000;
width:700px;
border-collapse:collapse;
padding:0px 0px 0px 0px;
border-spacing:0px 0px;
text-align:center;
vertical-align:top;
}
table.main-table-header-default td
{
border-collapse:collapse;
padding:0px 0px 0px 0px;
text-align:center;
vertical-align:top;
}
table.main-table-header-default tr
{
border-collapse:collapse;
padding:0px 0px 0px 0px;
text-align:center;
vertical-align:top;
}

和HTML:

<table class="main-table-default">
    <tr>
        <td>
            <table class="main-table-header-default">
                <tr>
                    <td><img src="http://i1.ytimg.com/vi/OguOU5cyikI/hqdefault.jpg" border="0">
                    </td>
                </tr>
                <tr>
                    <td><img src="http://i1.ytimg.com/vi/OguOU5cyikI/hqdefault.jpg" border="0">
                    </td>
                </tr>
            </table>
        </td>
    </tr>
</table>

图像之间有一些空间,我想摆脱ot,怎么可能这样做? 谢谢!

1 个答案:

答案 0 :(得分:2)

修改后的CSS:

body
{
background-color:#ffffff;
margin-top:0;
margin-bottom:0;
margin-left:0;
margin-right:0;
padding-top:0px;
}
table.main-table-default
{
margin:0px auto 0px auto;
background-color:#00ffff;
width:700px;
border-collapse:collapse;
padding:0px;
border-spacing:0px 0px;
text-align:center;
vertical-align:top;
}
table.main-table-default td
{
border-collapse:collapse;
padding:0px 0px 0px 0px;
text-align:center;
vertical-align:top;
line-height:0;
}
table.main-table-header-default
{
margin:0px auto 0px auto;
background-color:#000000;
width:700px;
border-collapse:collapse;
padding:0px 0px 0px 0px;
border-spacing:0px 0px;
text-align:center;
vertical-align:top;
}
table.main-table-header-default td
{
border-collapse:collapse;
padding:0px 0px 0px 0px;
text-align:center;
vertical-align:top;
}
table.main-table-header-default tr
{
border-collapse:collapse;
padding:0px 0px 0px 0px;
text-align:center;
vertical-align:top;
}

你可以在这个jsfiddle中查看:http://jsfiddle.net/Bf965/