Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/87.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_Href_Whitespace - Fatal编程技术网

Html 添加链接后表中的额外空间

Html 添加链接后表中的额外空间,html,css,html-table,href,whitespace,Html,Css,Html Table,Href,Whitespace,不久前,我遇到了一个问题,表格中的图像没有填充单元格,单元格被 但是,我现在有一个编辑,我需要添加链接到图像和文本。再一次,我遇到了同样的问题,我有多余的空格 <table> <tr> <td width="200px" height="175px" style="text-align: center; border: 0; background-color: #ffffff; padding: 0; margin: 0; border-c

不久前,我遇到了一个问题,表格中的图像没有填充单元格,单元格被

但是,我现在有一个编辑,我需要添加链接到图像和文本。再一次,我遇到了同样的问题,我有多余的空格

<table>
    <tr>
        <td width="200px" height="175px"  style="text-align: center; border: 0; background-color: #ffffff; padding: 0; margin: 0; border-collapse: collapse; "> 
            <a href="http://www.placekitten.com/"><img src="http://www.placekitten.com/200/175" style="display: block; padding: 0; border: 0;" /></a>
        </td>
    </tr>
    <tr>
        <td width="200px" height="25px"  style="text-align: center; border: 0; background-color: #535152; color: #fffdfe; padding: 0; margin: 0; border-collapse: collapse; ">
            <a href="http://www.placekitten.com/">Text</a>
        </td>
    </tr>
</table>

这是一个

这是一个填充的情况吗?或者什么?

添加以下CSS:

您还应该将样式从内联移动到样式表中

边框折叠CSS属性选择表的边框模型。这 对表格单元格的外观和样式有很大影响

分离模型是传统的HTML表边界模型。 相邻的单元都有各自不同的边界。距离 它们之间的间距由边界间距属性给定

在折叠的边框模型中,相邻的表格单元格共享边框。在里面 对于该模型,inset的边框样式值的行为类似于groove,并且 它的行为像山脊


您应该将
边框折叠:折叠
移动或添加到表中,而不是td

边框折叠
是一个
属性,而不是
td


更多信息:

谢谢-只有在我使用drupal时,您才能加载任何额外的样式表,或在页面开头添加样式部分:(因此我在标记中添加了style=“border collapse:collapse;”
table{
    border-collapse:collapse;
}