2013-04-13 55 views
3

My website没有内容上下滚动条是可见的,可以滚动。滚动条,但没有内容

不幸的是,我不知道会导致什么,我假设它与这个CSS代码有关,但我真的不知道。

html, body 
{ 
    height:100%; 
} 
.centre 
{ 
    position:absolute; 
    left:50%; 
    top:50%; 
} 
#wrapper { 
    height:100%; 
    position:relative; 
    left:0px; 
    top:0px; 
    min-height:600px; 
    min-width:600px; 
} 

网站上的所有内容均基于中心类。并且围绕所有内容<div id="wrapper"></div>

我知道我没有很好的帮助,但是从我的理解来看,如果可视区域之外有内容而且没有内容,则应该只有滚动条。

+0

重置您的默认值,它解决了'* {保证金:0;填充:0;}' –

+2

+1至少为您的问题上令人难以置信的有趣的讨论。 –

+0

同意Linus。 :D真棒有时简单的问题会产生如此多的反抗。 – pzin

回答

3

要么删除height: 100%<html/><body/>#wrapper或添加

html, body { margin: 0; } 
2

尝试加入这个CSS的样式表:

body {margin:0;} 
1

只需设置body利润率为零:

body { 
    margin: 0; 
} 

通常,浏览器为主体设置默认值。

0

只需在您的CSS顶部上重置即可。换句话说,这应该是第一行:

所有你需要重置document(browser default styles)default styles。要做到这一点的
* { margin: 0; padding: 0; outline: 0; } 
0

首先,将下面的代码添加到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, 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; 
} 

信用LINK