Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7871389
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T01:53:31+00:00 2026-06-03T01:53:31+00:00

What is the difference between position: relative and position: absolute in CSS? And when

  • 0

What is the difference between position: relative and position: absolute in CSS? And when should you use them?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T01:53:33+00:00Added an answer on June 3, 2026 at 1:53 am

    Absolute CSS Positioning

    position: absolute;

    Absolute positioning is the easiest to understand. You start with the CSS position property:

    position: absolute;
    

    This tells the browser that whatever is going to be positioned should be removed from the normal flow of the document and will be placed in an exact location on the page. It won’t affect how the elements before it or after it in the HTML are positioned on the Web page however it will be subject to it’s parents’ positioning unless you override it.

    If you want to position an element 10 pixels from the top of the document window, you would use the top offset to position it there with absolute positioning:

    position: absolute;
    top: 10px;
    

    This element will then always display 10px from the top of the page regardless of what content passes through, under or over the element (visually).

    The four positioning properties are:

    1. top
    2. right
    3. bottom
    4. left

    To use them, you need to think of them as offset properties. In other words, an element positioned right: 2px is not moved right 2px. It’s right side is offset from the right side of the window (or its position overriding parent) by 2px. The same is true for the other three.

    Relative Positioning

    position: relative;

    Relative positioning uses the same four positioning properties as absolute positioning. But instead of basing the position of the element upon the browser view port, it starts from where the element would be if it were still in the normal flow.

    For example, if you have three paragraphs on your Web page, and the third has a position: relative style placed on it, its position will be offset based on its current location– not from the original sides of the view port.

    Paragraph 1.

    Paragraph 2.

    Paragraph 3.
    In the above example, the third paragraph will be positioned 3em from the left side of the container element, but will still be below the first two paragraphs. It would remain in the normal flow of the document, and just be offset slightly. If you changed it to position: absolute;, anything following it would display on top of it, because it would no longer be in the normal flow of the document.

    Notes:

    • the default width of an element that is absolutely positioned is the width of the content within it, unlike an element that is relatively positioned where it’s default width is 100% of the space it can fill.

    • You can have elements that overlap with absolutely positioned elements, whereas you cannot do this with relatively positioned elements (natively i.e without the use of negative margins/positioning)


    lots pulled from: this resource

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

what is difference between relative position and absolute position is CSS eg .style {
What is the difference between margin-left: 10px; and position: relative; left: 10px; ? It
What the difference between jQuery's functions val() and text() ? Where would you use
What is the difference between position() and offset() ? I tried to do the
Is there a fundamental difference between how position:fixed; is handled by Firefox 3.0 and
I'm not in a position to make out the difference between vld4_f32 and vld4q_f32
What is the basic difference between CSS ID and CSS Class? Someone told me
Is there any difference between System.Windows.Forms.Cursor.Position and setCursorPos Does the usage of one or
I have two animations which are practically identical... the difference between them is left
The difference between Chr and Char when used in converting types is that one

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.