我使用引导:http://ironsummitmedia.github.io/startbootstrap-simple-sidebar/ 我想改变这个白色背景,但是当我生成一些数据和滚动页面时,它仍然是白色的。Bootstrap,滚动后没有背景
我已经在这个引导程序改为仅此:
html, body {
height: 100%;
}
#wrapper {
height: 100%;
width: 100%;
background: red;
我使用引导:http://ironsummitmedia.github.io/startbootstrap-simple-sidebar/ 我想改变这个白色背景,但是当我生成一些数据和滚动页面时,它仍然是白色的。Bootstrap,滚动后没有背景
我已经在这个引导程序改为仅此:
html, body {
height: 100%;
}
#wrapper {
height: 100%;
width: 100%;
background: red;
难道你现在只是有
body { background-color: red; }
或渐变,你可以这样做: -
#wrapper { background: red; /* For browsers that do not support gradients */ background: -webkit-linear-gradient(red, yellow); /* For Safari 5.1 to 6.0 */ background: -o-linear-gradient(red, yellow); /* For Opera 11.1 to 12.0 */ background: -moz-linear-gradient(red, yellow); /* For Firefox 3.6 to 15 */ background: linear-gradient(red, yellow); /* Standard syntax */ height: 100vh; }
你限制的相关要素视口高度的100%,这里的高度 - 这样超越了所有的内容,如果其容器流出元素,它不会增加超过100%的高度 - 这就是为什么你看到一个白色背景,因为这部分是在你指定的红色背景的元素之外。改为在包装上使用'min-height:100%'。 (或者'min-height:100vh' - 那么你不需要为'html'和'body'设置'height:100%''',这会导致滚动行为等更多的问题。) – CBroe