Đồn*_*ọng -1 html css whitespace document-body next.js
我通过create-next-app appname方法创建了一个Next.js应用程序。
我运行它没有任何变化。
在html和body之间显示如下图所示的空白。我不知道为什么,因为那里没有诸如边距或填充的设置。
如何删除此空白/间隙?
感谢您审核我的问题。
请尝试以下操作,因为,正文具有默认边距:http : //www.w3.org/TR/CSS2/sample.html
body { margin:0; } /* Remove body margins */Run Code Online (Sandbox Code Playgroud)
或使用全局重置
* { margin:0; padding:0; box-sizing:border-box; }Run Code Online (Sandbox Code Playgroud)
如果您想要的不是*全球性的东西,而不是:
html, body, body div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp, small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, figure, footer, header, hgroup, menu, nav, section, time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
outline: 0;
font-size: 100%;
vertical-align: baseline;
background: transparent;
}Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
58 次 |
| 最近记录: |