Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Aug 2002
    Location
    Sacramento, California
    Posts
    132
    Thanks
    0
    Thanked 0 Times in 0 Posts

    CSS Positioning ?

    What is the diference between

    position:relative;
    position:absolute;
    position:fixed;


    ?????

    please explain 4 me!

    Thank you!
    Hairynugs


    Simple is best.

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    Nashua, NH
    Posts
    1,724
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Vladdy | KL
    "Working web site is not the one that looks the same on common graphical browsers running on desktop computers, but the one that adequately delivers information regardless of device accessing it"

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    position: absolute;

    This is used to make a "layer" which can be repositioned anywhere on the web page (or even off the web page when you set negative x and/or y pixel locations). Any elements nested inside the tag with the absolute position are part of the layer and will move with it. The layer itself though isn't part of whatever tags it may have been nested within.

    position: relative;

    This works like position: absolute with the exceptions that it is a part of whatever tag it's nested within and the x/y positions are relative to the containing tag instead of to the window as a whole.

    position: fixed;

    This one is like absolute except the x/y position is set vs the viewing window and not the page. The difference is that an absolutely positioned element will scroll with the page while a fixed position element stays fixed at the same place in the browser window.

    Simplified, there's more but this is the basics.

    Edit: Oh yeah, IE doesn't support position: fixed; so you can't count on it yet.


  •  

    Posting Permissions

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