Html 页面太大,无法打开窗口

Html 页面太大,无法打开窗口,html,css,Html,Css,加载页面时,页面太大。我在页面上绝对定位了元素,但当我有一个足够大的窗口来容纳1900px/等内容时,没有一个元素超出页面的边界。换句话说,所有元素都可以放在主体内部,而不会超出我一直在测试的设备上的边界。我有一个div,它覆盖了页面的100%,还有一个水平滚动条,div可以向左移动大约100px,而不覆盖整个页面。当解析页面时,是否存在某种填充/etc使页面稍微超出其最外层元素,如果是这样,我将如何重置此设置 制造 使用Eric Meyer的重置 html, body, div, span,

加载页面时,页面太大。我在页面上绝对定位了元素,但当我有一个足够大的窗口来容纳1900px/等内容时,没有一个元素超出页面的边界。换句话说,所有元素都可以放在主体内部,而不会超出我一直在测试的设备上的边界。我有一个div,它覆盖了页面的100%,还有一个水平滚动条,div可以向左移动大约100px,而不覆盖整个页面。当解析页面时,是否存在某种填充/etc使页面稍微超出其最外层元素,如果是这样,我将如何重置此设置

制造


使用Eric Meyer的重置

html, 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, menu,
time, mark, audio, video {
margin:0;
padding:0;
border:0;
outline:0;
font-size:100%;
vertical-align:baseline;
background:transparent;
}

article, aside, figure, footer, header,
hgroup, nav, section { display:block; }

nav ul { list-style:none; }

blockquote, q { quotes:none; }

blockquote:before, blockquote:after,
q:before, q:after { content:''; content:none; }

a { margin:0; padding:0; font-size:100%; vertical-align:baseline; background:transparent; }

ins { background-color:#ff9; color:#000; text-decoration:none; }

mark { background-color:#ff9; color:#000; font-style:italic; font-weight:bold; }

del { text-decoration: line-through; }

abbr[title], dfn[title] { border-bottom:1px dotted #000; cursor:help; }

/* tables still need cellspacing="0" in the markup */
table { border-collapse:collapse; border-spacing:0; }

hr { display:block; height:1px; border:0; border-top:1px solid #ccc; margin:1em 0; padding:0; }

input, select { vertical-align:middle; }
/* END RESET CSS */

或者,如果仍然发生这种情况,请拨弄一下,这样我们就可以判断问题了。

我将所有内容都放在一个包含div的分区内,大小足以包围页面内容,将所述div上的边距设置为“自动”,将overflow-x设置为“隐藏”。现在看起来不错。我仍然没有弄明白为什么窗口会变大,但这对那些有同样问题的人来说是可行的

 body
 {
  margin: 0;
   padding: 0;
 }
html, 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, menu,
time, mark, audio, video {
margin:0;
padding:0;
border:0;
outline:0;
font-size:100%;
vertical-align:baseline;
background:transparent;
}

article, aside, figure, footer, header,
hgroup, nav, section { display:block; }

nav ul { list-style:none; }

blockquote, q { quotes:none; }

blockquote:before, blockquote:after,
q:before, q:after { content:''; content:none; }

a { margin:0; padding:0; font-size:100%; vertical-align:baseline; background:transparent; }

ins { background-color:#ff9; color:#000; text-decoration:none; }

mark { background-color:#ff9; color:#000; font-style:italic; font-weight:bold; }

del { text-decoration: line-through; }

abbr[title], dfn[title] { border-bottom:1px dotted #000; cursor:help; }

/* tables still need cellspacing="0" in the markup */
table { border-collapse:collapse; border-spacing:0; }

hr { display:block; height:1px; border:0; border-top:1px solid #ccc; margin:1em 0; padding:0; }

input, select { vertical-align:middle; }
/* END RESET CSS */