CSS: Position Property

By Xah Lee. Date: . Last updated: .

What is the Position Property

The position property lets you:

Possible Values

The position property has 4 possible values:

position ValueOwn LayerRelative To
staticno(Normal Flow) This is default.
relativenoRelative to its normal position.
fixedyesRelative to window.
absoluteyesRelative to its containing block.

position:static

The position:static is the default for all elements.

The position of element of position:static is either below the previous element, or to the right of the previous element.

If the previous element is a block element, then next element is positioned below it. (block elements are div, p, img, h1 etc.)

If the previous element is a inline element, then next element is positioned to the right of it (or below if container box width is reached). (inline elements are span, a (link), b (bold), etc.)

position:relative

position:fixed

position:absolute

Overlapping and z-index

CSS Layers

CSS, Layout