Position Property:

  • Position in css specifies how elements are positioned.
  • Syntax: property: value
  • Positioning values are
    1. static
    2. relative
    3. absolute
    4. fixed
    5. sticky
  • Static:All positions are static by default.
  • Relative: follows normal flow with top,left directions.
  • Absolute: the element is positioned to the edge.
  • Fixed: remains fixed, does't scroll with the content.
     Code:
     
     
     
     
    Output: