开发者

CSS <td> vertical spacing - can't make it go away

Trying to get rid of the vertical space between the 'td' tags on the following page:

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

How can I make it go away? I cannot figure it out. It isn't happening in IE at all, oddly.

Tried the following CSS, along with a reset CSS.

table {
    border-collapse: collapse;
    border-spacing: 0;
    width: 100%;
    margin: 0;
    padding: 0;
}
table td {
    margin:开发者_C百科 0;
    padding: 0;
}


Two things here:

In your body tag, you have set the line-height to 24px. You should override this for all table elements, or, in fact, just set it on p tags.

Also you have set the td .post-content .more to have a margin: 15px 0 so that is causing your rows to have an additional 15px top and bottom.


Your .label class is adding top+bottom padding/margins


This is an x-browser inconsistency use Eric Mayer's CSS Reset:

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

Add this to your StyleSheet:

/* 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;
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜