SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2000
    Location
    Somewhere
    Posts
    81
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Relative Positioning

    Hi,

    How can you posistion "div's" relative to each other?

  2. #2
    .net install meltdown
    Join Date
    May 2001
    Location
    View Ridge
    Posts
    692
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    By using percent values for bottom, left, right or top in conjunction with position: relative;.

    I use top and left, I've had varying results with left & bottom.

    Code:
    .somediv
      {
      left: 5%;
      top: 5%;
      position: relative;
      }
    This puts the top left corner of <div class="somediv"> to 5% of the top left corner of the parent container.

    Other properties such as padding, margin, width etc.. can also come into play depending on your layout.

    There's some good info & links on layout techniques at glish, indexdotcss gets into the specifics pretty well.


Bookmarks

Posting Permissions

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