为什么表单元格中有2个href元素时有额外的间距

Joh*_*ohn 5 html css html-table

图片胜过千言万语.注意最后一行和其余行之间的空格.

在此输入图像描述

这是代码.

<html>
<head></head>
<style type="text/css">
td a {
text-decoration: none;
color: black;
font-size:11px;
font-family: Arial, 
}
</style>
<body>
<table>
    <tr>
        <td width="120px"><a href="#" target="__blank">Now is the time for all good men to come to the aide of their country said the quick brown fox to the lazy cow.</a> <a href="#" target="__blank">Moo</a></td>
    </tr>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

如果我取出第二个标签并在第一个标签中包含Moo文本,则间距消失.这里发生了什么?

Jas*_*aro 2

现在你缺少结束语tdtable标签。他们可能是问题所在。

它对我来说用结束标签工作得很好:

示例: http: //jsfiddle.net/bmNRq/