I currently have three different divs on my webpage. Two of them are background divs stacked on top of each other, while the third one contains content and is positioned within the lower background div. My issue arises when I try to make the content div cover both background divs by giving it a negative top margin of -20px. While this adjustment looks correct in Dreamweaver, once I view it in Safari, the content div ends up pulling the lower background div upwards along with it.
<div style="height:40px; width:500px; margin-left:auto; margin-right:auto; background-color:#CF3; margin-top:100px;"></div>
<div style="height:100px; width:400px; margin-left:auto; margin-right:auto; background-color: #0FF;">
<div style="height:80px; width:300px; margin-left:auto; margin-right:auto; background-color: #F00; margin-top:-20px;"></div>
</div>
This is the result I was aiming for: Image of desired outcome http://www.snapfoot.com/audio/good.jpg
However, this is what I actually ended up with - not what I wanted. The blue background should stay in place, not move up with the red one. Unwanted result image http://www.snapfoot.com/audio/bad.jpg
If anyone can offer guidance on where I might be making a mistake, I would greatly appreciate it!