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 4 of 4

Thread: CSS Question

  1. #1
    Member Reza O's Avatar
    Join Date
    Nov 2012
    Posts
    53
    Member #
    33634
    Liked
    1 times
    Can someone explain position:absolute and relative. I understand fixed position but I don't quite get the other two or the uses for them.

    Thanks in advance for your help!

  2.  

  3. #2
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,483
    Member #
    425
    Liked
    2783 times
    Relative means "relative to where it would normally sit." In other words, if you have an element that's normally seated in the top left corner, you can use relative positioning to move it somewhere else (or, alternatively, define it as a relative positioning element for something with absolute positioning later on).

    Absolute means "this element will be positioned here, regardless of document flow." It's based on any relative positioned elements that exist (and the body if none do).
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

  4. #3
    Member Reza O's Avatar
    Join Date
    Nov 2012
    Posts
    53
    Member #
    33634
    Liked
    1 times
    Quote Originally Posted by TheGAME1264, post: 243628
    Relative means "relative to where it would normally sit." In other words, if you have an element that's normally seated in the top left corner, you can use relative positioning to move it somewhere else (or, alternatively, define it as a relative positioning element for something with absolute positioning later on).

    Absolute means "this element will be positioned here, regardless of document flow." It's based on any relative positioned elements that exist (and the body if none do).
    Thanks.

  5. #4
    Junior Member Hostwinds's Avatar
    Join Date
    Nov 2012
    Location
    Tulsa, OK
    Posts
    15
    Member #
    33777
    Liked
    2 times
    Absolute can be manipulated in such a way that the element that you're defining is placed anywhere on the screen, regardless of the position of the parent element or any others. Relative, however, defines its position in relativity to its original position. So if you were to have:
    position: relative;
    position-left: 20px;
    that would move your element 20px to the left (I think, it's been a while.)
    I hope that helps.


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 09:00 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com