position

The position property determines the position of an element's box.

CSS2

Syntax

position: static | relative | absolute | fixed | inherit
Initial: static
Applies To: all elements
Inherited: no
Percentages: NA
Media: visual

Values

position: value
Value Description
absolute Position is set with top, right, bottom, and left
fixed Position is set with top, right, bottom, and left and does not move when scrolled
relative Position is offset from normal with top, right, bottom, and left
static Position is normal

DOM

[window.]document.getElementById("element-id").style.position = "position";

Example | absolute

Example | fixed

Example | relative

Example | static

Example | DOM

External

W3C Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification