Problem with overlapping divs - CSS
Posted
by Chaitanya
on Stack Overflow
See other posts from Stack Overflow
or by Chaitanya
Published on 2010-06-03T15:14:58Z
Indexed on
2010/06/03
15:24 UTC
Read the original article
Hit count: 167
html, body {margin: 0px; padding: 0px;}
#pageContainer{ margin: auto; padding: auto;}
#contentContainer{ margin:150px; width:1100px; height: 100%; overflow: hidden; }
#leftContainer{ width: 80%; min-height: 800px; background: #009900; float:left;}
#left1{ margin:80px 0 0 80px; height: 550px; top:0px; z-index:1; background: #000000;}
#left2{ margin:80px 0 0 80px; height: 500px; top:110px; z-index:2000; background:#99FFFF; }
#rightContainer{ width: 20%; height: inherit; background: black; float:right;}
/ CSS Document */
I require 2 overlapping divs, which look like the one below.
----------------------
| |
| ------------------ |
| ' '|
| ' '|
| ' '|
| ' '|
| ' '|
| ' '|
| ' '|
----------------------
' '
' '
-------------------
<div id="pageContainer">
<div id="contentContainer">
<div id="leftContainer"> Am the left container
<div id="left1">
<div id="left2">
</div>
</div>
</div>
<div id="rightContainer">
</div>
</div>
</div>
The problem is am failing to get the overlap. Where am I going wrong?
Edit 1: topx was a typo, corrected it.
© Stack Overflow or respective owner