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.
Possible Values
The position
property has 4 possible values:
position Value | Own Layer | Relative To |
---|---|---|
static | no | (Normal Flow) This is 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.)