Skip to main content

What types of positioning exist in CSS?

There are five types of positioning:

Typeposition valueFeature
1staticDefault, in the flow, coordinates do not work
2relativeIn the flow, but can be shifted relative to its initial position
3absoluteOutside the flow, positioned relative to the nearest positioned ancestor
4fixedOutside the flow, fixed relative to the browser window
5stickyPartially in the flow, "sticks" to a given position on scroll

Coordinates (top, right, bottom, left) can only be used with relative, absolute, fixed, and sticky.

Short Answer

Interview ready
Premium

A concise answer to help you respond confidently on this topic during an interview.