我在这里做了一个整洁的小照相馆 - http://schnell.dreamhosters.com/wallpapers.php为什么我的一些表格单元比其他单元有更多的填充?
随意环顾四周,并采取了一些壁纸,如果你喜欢,这就是它的存在了。
不管怎么说,我遇到的问题是,如果你在列看起来非常接近,第一和最后的有从中间的那些不同量的填充。以下是相关的CSS此页......
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, font, 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 {
margin: 0;
padding: 0;
border: 0;
outline: 0;
font-size: 100%;
background: transparent;
}
a:visited {
color: blue;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
/* remember to define focus styles! */
:focus {
outline: 0;
}
/* remember to highlight inserts somehow! */
ins {
text-decoration: none;
}
del {
text-decoration: line-through;
}
/* tables still need 'cellspacing="0"' in the markup */
table {
border: solid 1px black;
border-collapse: collapse;
border-spacing: 0;
}
td {
border: solid 1px black;
padding: 5px;
text-align: center;
}
#gallery {
margin: 10px auto;
width: 960px;
}
#fancybox-title {
font-size: 1.2em !important;
font-weight: bold !important;
}
.nav {
font-weight: bold;
font-size: 1.1em;
text-decoration: none;
}
.padding {
padding: 0 0.75em;
}
我不标记,并且添加填充是TD标签的唯一CSS样式添加任何填充,所以我很困惑,为什么中心列比外部列获得更多的填充。我试图带走填充类,也许与链接的细胞正在使细胞的增长,使图像单元格需要更多的填充,但没有奏效。
抱歉,如果这似乎有点微不足道,但我倾向于是相当OCD,当它的代码涉及到视觉效果,有时还完美主义者。
这样做。我将宽度更改为900px,现在额外的填充已消失。也很有趣,因为我一直都认为我超过了960px的标记,但我猜不是。 – 2010-10-04 18:52:24