...

View Full Version : Parent child Positioning problem



moneysharma
05-20-2012, 10:57 AM
i am very much confused in the positioning in CSS.

Example:

<body style="position:relative;">

<div id="div1" style="position:relative;" >

<div id="div2" style="position:relative;" >

<div id="div3" style="position:absolute; ">
</div>

</div>


</div>
</body>




Then who will be the parent element of div3??..with respect to which element will it be positioned??
Note: Don't think that top and other coordinates are not written in code,as this is only an example to make me clear about parent and child things.

Please give the best explanation Sir.

MarPlo
05-20-2012, 11:35 AM
Hi,
From your code, the parent of div3 is div2, the element in which is directly included. Then, div2 has as parent div1.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum