In relative positioning, the element is positioned according to its normal position in the flow of the document. The top, right, bottom, and left properties can be used to offset the element relative to itself. This does not affect the positioning of other elements, as other elements won't be adjusted to fit into any gap left. It is treated in the layout as if it were static.
In absolute positioning, the element is positioned relative to the nearest positioned ancestor, or to the initial containing clock if none. This removes it from the normal document flow, and no space is created in the page layout for the element. Its positioning can be determined by the top, right, bottom, and left values.
In fixed positioning, the element is also removed from the normal document flow and no space is created in the page layout, like in absolute positioning. The element is positioned relative to the viewpoint, which causes it to stay in place even when the page is scrolled. The element's positioning is determined by the top, right, bottom, and left values.
The z-index property sets the stack order of positioned elements, which defines which elements should be placed in front of or behind other elements. Overlapping elements with a larger z-index cover those with a smaller one.