CSS: Position Property
What is the Position Property
The position property lets you:
- Adjust position of a element.
- Make a element into a separate layer.
Position Values
| position Value | New Layer | Relative To |
|---|---|---|
static | no | (Normal Flow). Default. |
relative | no | Relative to its normal position. |
fixed | yes | Relative to window. |
absolute | yes | Relative to its containing block. |
position:static
The position:static is the default for all elements.
The position of element of position:static is either below the previous element, or to the right of the previous element.
If the previous element is a block element, then next element is positioned below it. (block elements are div, p, img, h1 etc.)
If the previous element is a inline element, then next element is positioned to the right of it (or below if container box width is reached). (inline elements are span, a (link), b (bold), etc.)