Results 1 to 4 of 4

Thread: Div tag definitions... help.

  1. #1
    Join Date
    Aug 2005
    Location
    Dorset, England
    Posts
    46
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Div tag definitions... help.

    what does:

    absolute
    relative
    static

    mean when i use these on 'div' tags?

    From what I can gather so far 'relative' seems to create what I'd call a layer (dreamweaver user) that can placed in an exact position. As for the other two I can't see what they do.

    Thanks

  2. #2
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by FordCorsair
    what does:

    absolute
    relative
    static

    mean when i use these on 'div' tags?
    Precisely what they mean when you use them with pretty much any other element. They are CSS position property values that affect how an element is placed within the canvas, and how it affects other elements around it. The CSS specification explains the positioning schemes in more detail than I will here.

    The static value is default for all elements, and produces the normal flow of elements that you'll expect when writing unstyled markup.

    The relative value is similar to static in that the initial location of that element will be the same, and surrounding elements will behave as if the positioned element was in that location. How relative-positioning differs is through the use of the box offset properties (top, right, bottom, and left), which allow the element to be shifted from it's initial position.

    The absolute value is very different from the first two. First, it takes the element out of normal flow, which means that other elements act as though the positioned element doesn't even exist. Secondly, it is positioned with respect to a 'containing block'; an element with a position value other than static, or the initial containing block (the document root). The box offset properties specify how far the edges of the absolutely-positioned element are from the containing block.

    The fixed value, one that you omitted, is a subcategory of absolute positioning. The element isn't positioned relative to an element, but to the viewport. Unfortunately, IE doesn't support this.

    Mike

  3. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by mwinter
    The fixed value, one that you omitted, is a subcategory of absolute positioning. The element isn't positioned relative to an element, but to the viewport. Unfortunately, IE doesn't support this.
    Except for the page background.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  4. #4
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by jscheuer1
    Quote Originally Posted by mwinter
    The fixed value, one that you omitted, is a subcategory of absolute positioning.
    Except for the page background.
    Fixed backgrounds are rather unrelated to fixed positioning. However, IE gets both wrong.

    Ian Hickson has a test page for fixed backgrounds. IE renders the background on the body element correctly, but fails to render the element background in the proscribed manner.

    Be warned: My IE 5.5 crashed when I viewed this. IE 5.01 didn't render any of the images, though IE 4.01 behaved like IE 6. This is probably a problem with my installation, but be prepared.

    Mike

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
  •