body { background:#f2f2f2; font:normal 12px Arial; } #div1 { background:black; height:150px; width:80%; margin:20px auto; text-align:center; color:white; } .div2 { background:red; width:250px; height:50px; line-height:50px; top:15px; left:10px; bottom:40px; position:relative; } .div3 { background:green; width:250px; height:50px; line-height:50px; top:15px; left:40px; position:relative; }
<div id='div1'> <div class='div2'>Ini DIV2 dengan top:15px dan left:10px</div> <div class='div3'>Ini DIV2 dengan top:15px dan left:40px</div> </div>