The CSS position property is used in positioning an element. It can be used in conjunction with the top, right, bottom and left properties to position an element where you want it.
Also see the float property.
- static - The element flows as normal. The left and top properties don't take effect.
- relative - The element is offset relative to it's normal position in the flow.
- absolute - The element is positioned based on it's containing block. The element is taken out of the normal flow. Any subsequent elements will not be impacted - they will appear where they normally would even if the previous element was not offset.
- fixed - Similar to absolute, but also doesn't move when scrolled.
||All elements except for generated content
|Try it yourself!
Enjoy this page?
- Link to this page (copy/paste into your own website or blog):
- Link to Quackit using one of these banner ads.
Thanks for supporting Quackit!