简体   繁体   English

网站中的高度问题

[英]Height issues in website

I am creating a site for which I have created a structure but I am facing height issue in that. 我正在创建一个已经为其创建结构的站点,但是我正面临着高度问题。 here is what I am expecting 这是我所期待的

期待中

but this is what I am getting 但这就是我得到的

最后 Below is the CSS: 下面是CSS:

html {height:100%!important;}
body {
    margin:0;
    font:12px/15px "Lucida Sans Unicode", "Lucida Grande", sans-serif;
    color:#8a8a8a;
    min-width:1000px;
    background:#fff;
    min-height:100%!important;
}

#wrapper {
    position:relative;
    min-height:100%;
    overflow:hidden;
    background:url(../images/wrapper.jpeg) repeat-y;
}
#content {
    float:left;
    width:100%;
    min-height:100%;
}

100% is just getting set to 100% of the content in it , try using a pixel height instead 100%只是设置为其中100%的内容,请尝试使用像素高度

#content {
    float:left;
    width:100%;
    min-height:500px;
}

I would put a min-height in pixels on your wrapper. 我会在您的包装纸上放一个min-height以像素为单位)。 Since the #content is set to 100% height, it will fill all of the wrapper. 由于#content设置为100%高度,它将填充所有包装。

This way, if there is less content than needed to fill the full height of the browser, the page will add whitespace below your content to fill the browser height. 这样,如果内容不足以填满浏览器的全部高度,则页面将在内容下方添加空格以填满浏览器的高度。 I do this often when first building out a new page, since I don't have any content, but want to get an idea of how it will look when filling the browser window. 我第一次建立新页面时经常这样做,因为我没有任何内容,但想了解一下填充浏览器窗口时它的外观。

I would suggest doing something like this: 我建议做这样的事情:

#wrapper {
    position: relative;
    min-height: 600px;
    overflow: hidden;
    background: url(../images/wrapper.jpeg) repeat-y;
}

You might want to adjust the min-height in pixels to fit your site- whatever it takes to make it fill the browser window. 您可能需要调整min-height以像素为单位)以适合您的网站-使其填满浏览器窗口所需的一切。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM