Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 5 of 5
  1. #1
    Senior Member kade119's Avatar
    Join Date
    Feb 2007
    Location
    USA
    Posts
    532
    Member #
    14888
    Liked
    1 times
    there is fixed, relative, static, none ..... ive seen a few articles on them, .. fixed means the image or component will stay in the exact spot no matter what the document flow is , correct?

    and then relative the image will stay closest to the nearest positioned component, correct?

    so when do we really need to use these positions? besides like on the container..

    thanks in advance

  2.  

  3. #2
    Member Taffu's Avatar
    Join Date
    Dec 2006
    Posts
    34
    Member #
    14486
    A common use for a relative position is when you're trying to build something on a predetermined layout when size & positioning becomes key to the flow of the page. For example, using a Relative position, you can indicate a container (div) to be a certain distance from the absolute position of the page by using a "left: Xpx". What this does is move the container X pixels from the left side of the page. This is handy if you're doing something like using a navigation container in an absolute position (on the left side of the page), and want the container to the right of it to be a predetermined distance to give way to the nav container (say your nav container is 150px wide, you would want the container to the right to be at least 150px from the left using a relative position with left: 150px).
    Owner - http://www.project-guild.com (in development)

  4. #3
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    One thing to remember is that absolute positioning is made with respect to the first relatively positioned parent element. This means you can give an element relative positioning, and then absolute position a child with respect to that element. Relative positioning typically means that the element will still take up the space it would normally, in the location it would normally, but you can also offset it from there. I haven't seen too many places to use relative positioning alone, since relative positioning on its own doesn't actually pull the element out of the document flow, so, like I said above, it still takes up space in its original location, pre-repositioning.

    Static is the normal positioning scheme.

    Fixed positioning is occasionally used for menus, so that they stay in the same place with respect to the body of the page. However, it isn't well-supported by IE6 (see this page for a hackish fix).IE7 supports it fine.

    I don't think there's such a thing as a `none' value for positioning.

    There's a fairly good description of the available properties over in the CSS2.1 spec.

  5. #4
    Senior Member kade119's Avatar
    Join Date
    Feb 2007
    Location
    USA
    Posts
    532
    Member #
    14888
    Liked
    1 times
    Thanks to both of you, believe I am beginning to understand when to use.... positioning..

    or am i...


    so is absolute position ever used alone?

    Relative position is used in with respect to an absolute position, correct..?


    For ex. I have a box on the left side of the page and I give it a relative position, then i have some copy that I want to stay on the right side of the page exactly 35px from the box.. i would set th ecopy to absolute positioning?

  6. #5
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    Yes, but it would be positioned with respect to the left and top and bottom and right of the relatively positioned element, if it was inside it.

    Basically, if there are no relatively positioned parent elements, then absolute positioning positions with respect to the entire page. If there is a relatively positioned parent, then absolute positioning positions with respect to the nearest such parent.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 03:00 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com