HTML Dog

Skip to navigation

CSS Property: position

How a box’s position is calculated.

A box can be positioned with the top, right, bottom, and left properties. These will have different effects depending on the value of position.

Boxes with position: absolute applied and stacked on top of one another.

Possible Values

ValueDescription
staticFollows the normal flow in a layout. top, right, bottom, and left have no effect. Default.
relativePosition is offset from the box’s initial position.
absoluteBox is taken out of the flow and positioned in relation to its containing box.
fixedThe same as absolute only the box will remain fixed in the viewport and will not scroll with the rest of the page’s content.
inherit
initial
unset

Example


#oogabooga {
    position: relative;
    left: 1em;
    top: 1em;
}