CSS position Property

The position property specifies the type of positioning method used for an element (static, relative, absolute, fixed, or sticky).

The CSS position property is used to set position for an element. it is also used to place an element behind another and also useful for scripted animation effect.

You can position an element using the top, bottom, left and right properties. These properties can be used only after position property is set first. A position element's computed position property is relative, absolute, fixed or sticky.

CSS Syntax

position: static|absolute|fixed|relative|sticky|initial|inherit;

Example -