SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    gingham dress, army boots... silver trophy redux's Avatar
    Join Date
    Apr 2002
    Location
    Salford / Manchester / UK
    Posts
    4,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    absolute positioning...am i misunderstanding the small print ?

    i'm having a spot of trouble with my (limited) knowledge of CSS positioning.
    the page that's giving me grief is www.onedayfilms.com/index.shtml (part of a new redesign of the site). i'd like the text links "home about..." etc to be positioned at the bottom of the header, just above the dashed border.
    now, according to http://www.w3.org/TR/REC-CSS2/visure...propdef-bottom
    For absolutely positioned boxes, the offsets are with respect to the box's containing block.
    the text links are in a div called "navlinks", which, in turn, is contained within a div called "header". so, according to the CSS spec, shouldn't the style attributes
    Code:
    	position: absolute;
    	bottom: 0%;
    move it to the bottom of "header", as that is the "containing block" ?
    at the moment, it's always moving the div down to the bottom of the browser window itself.
    am i misunderstanding the issue ? is there a way around this, other than definining the absolute position in pixels from the top ?
    re·dux (adj.): brought back; returned. used postpositively
    [latin : re-, re- + dux, leader; see duke.]
    WaSP Accessibility Task Force Member
    splintered.co.uk | photographia.co.uk | redux.deviantart.com

  2. #2
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,352
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    Here's a quote from Eric Meyers programmers reference book that might clear it up a bit for you.

    "In the case of postion: absolute the containing block of the positioned element is the nearest ancestor element which has a property position other than static.

    If no ancestor exists then the containing block is the root element of the document which is effectively the html element and not the body element. This will start the containing block at the top left corner of the document, outside any margins set on the body element."

    Which i think means that an absolutely positioned element will only be absoloutely positioned in a containing box as long as that containing box itself also has a value for the property position (other than static.)

    (So try adding position:relative to your #header style and see what happens.)

    Hope this helps a bit.

    Paul
    Last edited by Paul O'B; Mar 30, 2003 at 14:33.

  3. #3
    gingham dress, army boots... silver trophy redux's Avatar
    Join Date
    Apr 2002
    Location
    Salford / Manchester / UK
    Posts
    4,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you're a star Paul ! it worked like a charm.
    re·dux (adj.): brought back; returned. used postpositively
    [latin : re-, re- + dux, leader; see duke.]
    WaSP Accessibility Task Force Member
    splintered.co.uk | photographia.co.uk | redux.deviantart.com


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
  •