back

Position

This is used to define how an element is positioned.
Relative, absolute, and fixed elements can then be moved using top, bottom, left and right properties.

The options are:
(1) Static, the default value, it means that the element will be placed in the normal manner in its current page position.
(2) Relative, the element starts from where it would normally be under "static" but can then be offset relative to this position. A relative element remains in the content flow in its original ("static") position.
(3) Absolute, an absolutely positioned element is removed from the content flow which allows you to use the positioning elements to set its exact location.
(4) Fixed, fixed is similar to absolute, but a fixed element will remain where it is in the browser window, even if you scroll the page.
(5) Inherit, the value is inherited from its parent element.


Example