0

我的网站目前在小屏幕上是这样的:http:
//d.pr/i/KwI8+

在大屏幕上就像
http://d.pr/i/ckmF+

但我需要这样:
http ://d.pr/i/IJc7+

现场演示在http://www.random-radio.net/

CSS

html, body{
    width:100%; 
    min-height: 100%;
    height: auto !important;        
    height:100%;

    margin:0 !important;
    padding:0 !important;
    opacity: 0.99;

    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;

    box-sizing: border-box;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;

    background-color: #cfcfcf;
}

#page
{
    position: relative;
    top: 0px;
    bottom: 0;
    left: 50%;
    margin-left: -512px;
    width: 1024px;
    overflow: visible;
    background-color: #FFF;
    /*margin-left: auto;
    margin-right: auto;*/
}

我想要div从页面顶部到页面底部。我目前正在尝试使用上面的CSS,但是在高于内容的屏幕上div,背景获得#cfcfcf了正文的背景

4

1 回答 1

4

你需要div有一个height: 100%和 的背景#ffffff

html, body {margin: 0; padding: 0; height: 100%;}
#page {margin: 0 auto; width: 1024px; height: 100%; background-color: #ff0000;}

看这个演示

于 2013-01-15T20:14:26.910 回答