37 users online (0 members and 37 guests)  


  Results 1 to 2 of 2

Related

  1. Word break for relative columns    Forum: HTML Forum
    Replies: 0
  2. relative positioned layer problem    Forum: CSS Forum
    Replies: 1
  3. Relative Positioning    Forum: CSS Forum
    Replies: 1
  4. folders and relative paths    Forum: Javascript Forum
    Replies: 4
  1. #1
    calhcm22's Avatar
    New User

    Status
    Offline
    Join Date
    Feb 2003
    Posts
    4

    relative positioning, i think

    I'm trying to put my websites into xhtml and use css and div tags to layout my sites. I'm trying to figure out how to have subsequent layers position themselves relative to the layer positioned above them. For example, I have one layer with a banner, the following layer is content. The content layer changes size due to the amount of text or graphics in there at the time, so I need the layer positioned below that to be able to move accordingly. How do I do this? Thanks in advance.

  2. #2
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    You have pretty much answered your own question in your topic title.

    Sounds like you need to use relative positioning.

    The difference between relative positioning and absolute is that relative does not 'collapse' the space occupied by the html element. This means that if you do

    Code:
    position: relative;
    top: +20%;
    then the element will move 20% from where it would have been anyway. This makes page layouts much easier to do, as the html still 'flows' as it were.

    Best bet is to have a play. Also, http://css.somepeople.net uses two absolute divs for nav and 2-3 relative divs for the content. have a look, it might help.
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?



Tags for this Thread