View Full Version : Parent child Positioning problem

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


<body style="position:relative;">

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

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

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



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.

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