Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 表单元格之间的空间_Html_Css_Html Table - Fatal编程技术网

Html 表单元格之间的空间

Html 表单元格之间的空间,html,css,html-table,Html,Css,Html Table,因为那件事我完全疯了。我尽了我所能,但没有任何效果 范例 CSS body { margin-top:0; margin-bottom:0; margin-left:0; margin-right:0; } table.gh { margin:0px auto 0px auto; background-color:#00ffff; width:700px; border-collapse:collapse; padding:0px 0px 0

因为那件事我完全疯了。我尽了我所能,但没有任何效果

范例

CSS

body
{
   margin-top:0;
   margin-bottom:0;
   margin-left:0;
   margin-right:0;
}
table.gh
{
   margin:0px auto 0px auto;
   background-color:#00ffff;
   width:700px;
   border-collapse:collapse;
   padding:0px 0px 0px 0px;
   border-spacing:0px 0px;
   text-align:center;
   vertical-align:top;
}
table.gg
{
   margin:0px auto 0px auto;
   background-color:#00ffff;
   width:700px;
   border-collapse:collapse;
   padding:0px 0px 0px 0px;
   border-spacing:0px 0px;
   text-align:center;
   vertical-align:top;
}
HTML体内:

<table class="gh">
   <tr>
      <td>
         <table class="gg">
            <tr>
               <td><img src="http://www.astrofotos.info/var/resizes/casb/Eclipse-Austr%C3%A1lia-2012/IMG_5631.jpg?m=1352856326" border="0"></td>
            </tr>
         </table>
      </td>
   </tr>
</table>


现在。。。你看到图片和页面顶部之间有一点空间了吗?我怎样才能摆脱它

表格单元格的填充导致了您的问题

添加这段小代码,它将起作用:

table.gh td {
    padding: 0;
}

天啊!我真不敢相信,伙计。。。你真了不起D大个子男人!非常感谢!