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 to the CF scene
    Join Date
    Mar 2005
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    relative positioning

    i can't seem to find the details i'm looking for elsewhere...

    2 questions:

    1. when setting the relative positioning of an object, what determines what it's relative to?

    2. is there a way to force an object to be positioned relative to another specific object?


    many thanks from a novice,

    -adam

  • #2
    Senior Coder
    Join Date
    Jan 2005
    Location
    Memphis, TN
    Posts
    1,785
    Thanks
    8
    Thanked 131 Times in 129 Posts
    <div id="one">
    <div id="two" style="position:relative">
    stuff
    </div>
    </div>

    Div 2 is relative to Div 1 as its nested in Div 1.

    <div id="two" style="position:relative">
    <div id="one">
    stuff
    </div>
    </div>

    Div 2 is relative to the page.

    An element is relative to what ever is containing it.


  •  

    Posting Permissions

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