SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast weich1213's Avatar
    Join Date
    Nov 2008
    Posts
    89
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question I have a css question....

    I read in a book that if you use absolute positioning the element that you are positioning becomes independent of the surrounding elements in the markup, and is now positioned with respect to the top-level element, body. However when I try and use it in my page it's not turning out that way. It's turning out positioned with respect to the element that is above it in the html part of the site. Can anyone tell me why this is and what I can do to make the absolutely positioned element positioned with respect to the body element which should be 0px from the top and 0px from the left of the page? Thanks

  2. #2
    Guru in training bronze trophy SoulScratch's Avatar
    Join Date
    Apr 2006
    Location
    Maryland
    Posts
    1,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's relative to the nearest positioned parent ( anything but static ) or the viewport - if you have position:relative on its parent that would limit the area in which its absolutely positioned in. You can either remove the position:relative from the parent ( but this may mess other positioned elements inside) or move it outside of the position:relative so it's a direct sibling of body, assuming body is not positioned.
    Cross browser css bugs

    Dan Schulz you will be missed

  3. #3
    SitePoint Enthusiast weich1213's Avatar
    Join Date
    Nov 2008
    Posts
    89
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thank you


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
  •