使一个div与另一个div重叠-创建了jsfiddle



我需要在下面的黑色区域上有白色的"内容区域"。。。

http://jsfiddle.net/vUrhY/

我摆弄了z索引和边距,但似乎无法让它发挥作用。基本上,黑色会在白色的下面,你可以看到黑色背景上的白色内容边缘。非常感谢。

body{background-color:#999;}.div-main{height:200px;width:400px;z-index:1000;background:#fff;padding:30px 0 30px 0;max-width:1000px;margin:0 auto;}
.footer_filler{background-color:#000; width:100%; height:300px;z-index:-1;}

研究CSS中的position样式规则。

https://developer.mozilla.org/en-US/docs/Web/CSS/position?redirectlocale=en-美国&重定向段塞=CSS%2位置

具体来说,您可以查看绝对定位或相对定位。

最新更新