2

试图摆脱下一页上“td”标签之间的垂直空间:

http://framework.matthewruddy.com/2008/09/04/layout-test/3/

我怎样才能让它消失?我想不明白。奇怪的是,它根本没有发生在 IE 中。

尝试了以下 CSS 以及重置 CSS。

table {
    border-collapse: collapse;
    border-spacing: 0;
    width: 100%;
    margin: 0;
    padding: 0;
}
table td {
    margin: 0;
    padding: 0;
}

4

2 回答 2

3

您的.label班级正在添加顶部+底部填充/边距


这是使用 Eric Mayer 的 CSS 重置的 x 浏览器不一致:

http://meyerweb.com/eric/tools/css/reset/

将此添加到您的样式表中:

/* http://meyerweb.com/eric/tools/css/reset/ 
   v2.0 | 20110126
   License: none (public domain)
*/

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure, 
footer, header, hgroup, menu, nav, section {
    display: block;
}
body {
    line-height: 1;
}
ol, ul {
    list-style: none;
}
blockquote, q {
    quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
    content: '';
    content: none;
}
table {
    border-collapse: collapse;
    border-spacing: 0;
}
于 2011-03-18T23:20:44.193 回答
3

这里有两件事:

在您的body标签中,您已将 设置line-height24px。您应该为所有表格元素覆盖它,或者实际上,只需在p标签上设置它。

此外,您已将 设置td .post-content .more为具有 a margin: 15px 0,从而导致您的行的顶部和底部有额外的 15px 。

于 2011-03-18T23:28:55.583 回答