use absolute positioning, which will make the inner div's position absolute to the parent div (aka containing block).
And I would recommend not using inline styles and use a stylesheet:
<style type="text/css">
#top
{
position:relative;
border: 1px solid red;
width:400px;
height:150px;
margin:0px auto;
}
#child1, #child2
{
position: absolute;
border: 1px solid red;
width: 262px;
height: 20px;
left: 20px;
}
#child1
{ top: 20px; }
#child2
{ top: 60px; }
</style>
<div id="top">
<div id="child1">div-1</div>
<div id="child2">div-2</div>
</div>
http://kilianvalkhof.com/2008/css-xhtml/understanding-css-positioning-part-1/
Chad Grant
2009-05-08 10:06:17