将 div 背景设为白色
Make a div background white
这可能看起来很简单,但我正在尝试将 div 背景设为白色,但我做不到!
您可以在此处看到一个正在开发的站点:
http://www.issencial.com/2015/
我有一个视频背景,一个带导航(rt-header)的 div,然后是一个我想要白色的 div(rt-feature),所以当人们向下滚动时,它会重叠视频一.
我想应该是都设置好了,但是只有内容是白色的,不是全部div...
谁能帮我解决这个问题?
非常感谢...
是否...
background-color:white;
在 "rt-grid-12 rt-alpha rt-omega" 达到你想要的效果?
您没有将位置指定为绝对位置,因此默认情况下它处于位置
:静态的 。该元素相对于其第一个 positioned.And 定位,而不是使用背景,仅使用背景色,因为它的 div.Try 具有以下代码
#rt-feature {
background-color: #ffffff;
width: 100%;
position: absolute;
}
#rt-header {
background-color: #ffffff;
box-shadow: 0 1px 2px #000000;
position: fixed;
width: 100%;
z-index: 99;
}
添加CSS属性
#rt-feature { position: relative;}
应该是:
#rt-feature {
background: none no-repeat scroll 0 0 #fff;
position: relative;
}
这可能看起来很简单,但我正在尝试将 div 背景设为白色,但我做不到!
您可以在此处看到一个正在开发的站点:
http://www.issencial.com/2015/
我有一个视频背景,一个带导航(rt-header)的 div,然后是一个我想要白色的 div(rt-feature),所以当人们向下滚动时,它会重叠视频一.
我想应该是都设置好了,但是只有内容是白色的,不是全部div...
谁能帮我解决这个问题?
非常感谢...
是否...
background-color:white;
在 "rt-grid-12 rt-alpha rt-omega" 达到你想要的效果?
您没有将位置指定为绝对位置,因此默认情况下它处于位置 :静态的 。该元素相对于其第一个 positioned.And 定位,而不是使用背景,仅使用背景色,因为它的 div.Try 具有以下代码
#rt-feature {
background-color: #ffffff;
width: 100%;
position: absolute;
}
#rt-header {
background-color: #ffffff;
box-shadow: 0 1px 2px #000000;
position: fixed;
width: 100%;
z-index: 99;
}
添加CSS属性
#rt-feature { position: relative;}
应该是:
#rt-feature {
background: none no-repeat scroll 0 0 #fff;
position: relative;
}