CSS Tutorial

The language for styling web pages.

CSS Position

CSS Position

The position property specifies the type of positioning method used for an element.

Position Values:

  • static - Default. Not positioned specially
  • relative - Positioned relative to its normal position
  • absolute - Positioned relative to nearest positioned ancestor
  • fixed - Positioned relative to the viewport (stays on scroll)
  • sticky - Toggles between relative and fixed based on scroll

Try It Yourself

Edit the code below and click Run to see the result live.

Source Code
Result
Topics