Menu Samaritan's Purse

POSITION

The position property determines which of the positioning schemes is used to calculate the position of a box.

SYNTAX

CSS

position: value;

JS

object.style.position = "value";

VALUES

<'position'> = static | relative | absolute | sticky | fixed
static

The box is not a positioned box, and is laid out according to the rules of its parent formatting context.

relative

The box is laid out as static, then offset from the resulting position.

absolute

The box is positioned and sized solely in reference to its absolute positioning containing block. It is taken out of flow, meaning it has no impact on the size or position of its siblings and ancestors, and does not participate in its parent's formatting context.

sticky

Identical to relative, except that its offsets are automatically adjusted in reference to the nearest ancestor scroll container's scrollport in whichever axes the inset properties are not both auto, to try to keep the box in view within its containing block as the user scrolls.

fixed

Same as absolute, except the box is positioned and sized relative to a fixed positioning containing block.

INITIAL

static

EXAMPLES

ABSOLUTE

FIXED

RELATIVE

STATIC

STICKY

JS

INTERNAL

bottom

left

right

top

EXTERNAL

World Wide Web Consortium (W3C)