使用CSS重置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;
}
這實際上是CSS導致您的屏幕截圖的佈局? '高度:450px'應該在所有瀏覽器中都相當一致... – ptriek 2012-01-03 22:07:38
@ Ptriek-I同意你的觀點,但是如何擺脫這個問題?正如Daff提到的那樣,設置html高度也不太合適。 – coder 2012-01-03 22:09:24
如果我在[jsfiddle](http://jsfiddle.net/ptriek/bD8PW/)中的所有瀏覽器始終在450像素的高度渲染代碼,則代碼中必須有其他內容導致此問題... – ptriek 2012-01-03 22:12:46