Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    May 2012
    Posts
    17
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Question Parent child Positioning problem

    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.

  • #2
    Regular Coder
    Join Date
    Mar 2011
    Posts
    148
    Thanks
    0
    Thanked 20 Times in 20 Posts
    Hi,
    From your code, the parent of div3 is div2, the element in which is directly included. Then, div2 has as parent div1.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •