Positioning is a way to specify the location of an element anywhere on the page with pixel precision.

Property: position

Values: static | relative | absolute | fixed | sticky

Default: static

Applies to: all elements

Inherits: no

Once you've established the positioning method, the actual position is specified with some combination of up to four offset properties: top, right, bottom, left.

Note: Negative values are acceptable and move the element in the opposite direction of positive values. For example, a negative value for top would have the effect of moving the element up.

By default, elements stack up in the order in which they appear in the document, but you can change the stacking order with the z-index property.

Property: z-index

Values: number | auto

Default: auto

Applies to: positioned elements

Inherits: no

The value of the z-index property is a number (positive or negative). The higher the number, the higher the element will appear in the stack (that is, closer to your nose).