始終使用重置樣式時,你正在做應用的跨瀏覽器,這樣你可以很容易地解決所有的不一致,你可以嘗試一些基本的東西,如:
* {
margin: 0;
padding: 0;
}
或者使用一些其他的「更完整「喜歡這裏的那些解決方案:
例如Eric Meyer’s Reset Styles
告訴我們使用方法:
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;
}
希望它能幫助!
你嘗試過'html,body {padding:0;餘量:0; }' – Andy 2012-08-05 15:10:51
我試圖:html,body { \t \t \t \t margin-left:0px; \t \t \t \t margin-top:0px; \t \t \t \t background-color:#0ff; \t \t \t \t padding:0;保證金:0; \t \t \t} 不工作 – 2012-08-05 15:15:15
我沒有看到任何填充??? – 2012-08-05 15:45:44