What are the different values of the position property in CSS?

The position property has five values.

ValueMeaning
staticDefault, normal flow
relativeOffset from its normal place, the space stays reserved
absolutePlaced against the nearest positioned parent, removed from the flow
fixedPlaced against the browser window, stays while scrolling
stickyNormal until a scroll point, then sticks
.parent { position: relative; }
.badge { position: absolute; top: 0; right: 0; }

See CSS Position.


Learn more about the similar topics:
Tutorials
CSS Layout – The display Property
CSS Position Property
CSS z-index
CSS Float and Clear Property
Exercises & Assignments
Write CSS to centre a box horizontally using margin auto
Write CSS to create a horizontal navigation menu
Interview Questions & Answers
What is the use of float property in CSS?
What is the difference between display none and visibility hidden?
What is the difference between inline, block and inline-block?
What are the different values of the position property in CSS?
What is z-index in CSS?
What is clearfix in CSS?
How to hide an element in CSS?