The position property
identifies that an element is to be positioned and selects one of four
positioning methods (each will be discussed in detail in upcoming
sections in this chapter):
-
static This is the normal positioning scheme in which element boxes are rendered in order as they appear in the document flow.
-
relative Relative positioning moves the element box, but its original space in the document flow is preserved.
-
absolute Absolutely positioned objects are completely removed from the document flow and are positioned relative to their containing block (discussed in the next section). Because they are removed from the document flow, they no longer influence the layout of surrounding elements, and the space they once occupied is closed up. Absolutely positioned elements always take on block behaviors.
-
fixed Fixed positioning is like absolute positioning (the element is removed from the document flow), but instead of a containing element, it is positioned relative to the viewport (in most cases, the browser window).