CSS positioning: absolute trouble

Discussion in 'CSS' started by davo666, Dec 17, 2007.

  1. #1
    Hi, i need to position a div where absolute refers to its containing div

    <div id="1">
    <div id="2">
    blahblahblah
    </div>
    blahblahblah
    </div>

    div 2 position: absolute
    left: 20px;
    top: 20px;
    will be 20 px from the top od div 1....

    i dont know how to do it, but i know it has something to do with parent containers...


    thanks in advance
     
    davo666, Dec 17, 2007 IP
  2. soulscratch

    soulscratch Well-Known Member

    Messages:
    964
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    155
    #2
    position:relative on the parent element.
     
    soulscratch, Dec 17, 2007 IP