html - 当它有 2 个 href 元素时,为什么在表格单元格中有额外的间距

标签 html css html-table

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

enter image description here

这是代码。

<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>

如果我取出第二个 a 标签并将 Moo 文本包含在第一个 a 标签中,间距就会消失。这是怎么回事?

最佳答案

现在您缺少关闭 tdtable 标记。他们可能是问题所在。

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

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

关于html - 当它有 2 个 href 元素时,为什么在表格单元格中有额外的间距,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7744503/

相关文章:

php - 在 PHP 中使用 Pdfcrowd 将 HTML 转换为 PDF

javascript - 通过 javascript 清除和更新 html5 应用程序缓存

CSS 溢出与 div

html - 如何着手使这个总结工作?

css - div#myid 和 div #myid 之间的区别

php - 静态页面有效,但是当放入 PHP 时,CSS 无法正确呈现

javascript - 发生ng点击功能时如何更改跨度的文本颜色和背景颜色

html - 如何使用重叠的 float div?

javascript - 打印预览前的页面格式

php - 为什么要插入额外的可用列?