locked
What is difference between CSS absolute and relative positioning RRS feed

  • Question

  • User264732274 posted

    please give me a easy example which explain the difference between CSS absolute and relative positioning. thanks

    Tuesday, August 23, 2016 12:05 PM

Answers

  • User475983607 posted

    please give me a easy example which explain the difference between CSS absolute and relative positioning. thanks

    Please see any openly published CSS reference documentation.

    Absolute:
    The element is positioned relative to its first positioned (not static) ancestor element

    Relative:
    The element is positioned relative to its normal position, so "left:20px" adds 20 pixels to the element's LEFT position

    Reference:
    http://www.w3schools.com/cssref/pr_class_position.asp

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, August 23, 2016 12:19 PM