使整页白色 [英] Make full page white

查看:114
本文介绍了使整页白色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的网站目前在小萤幕上像这样:

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; * /
}

code> div 从页面的顶部到页面的底部。
我目前正试图使用​​上面的CSS,但是在一个高于 div 的内容的屏幕上,后台获取 #cfcfcf 正文背景

解决方案

具有高度:100%和背景为 #ffffff

/ p>

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



查看演示


My website is currently like this on little screens:
http://d.pr/i/KwI8+

And on big screens it's like
http://d.pr/i/ckmF+

But I need to have it like this:
http://d.pr/i/IJc7+

Live demo is on 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;*/
}

I want a div from the top of the page to the bottom of the page. I'm currently trying to use the above CSS, but on a screen that is higher than the content of the div, the background gets the #cfcfcf background of the body

解决方案

You need to have a div that has a height: 100% and a background of #ffffff.

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

See this demo

这篇关于使整页白色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆