Css allows to define exactly where an element should be rendered.
The possible values are.
Properties | Description |
---|---|
static | corresponding to the normal flow (default) |
relative | the element participates in normal flow but rendered with an offset relative to its normal position. After this translation, the element can overlap other elements |
absolute | The element is eliminated from the normal flow and is rendered with an offset relative to the first positioned parent element |
fixed | The element is eliminated from the normal flow and is rendered with an offset relative to the view-port. Its position remains the same when the content of the page is scrolled using the navigation bars. |
position
property is set to any value other than static
- The edges of the box corresponding to the positioned element are defined by the following propertiesProperties | Description |
---|---|
top | |
right | |
bottom | |
left |
The possible values are
Properties | Description |
---|---|
<length> | |
<percentage> | |
auto | |
inherit |
Defines a relative position for an element.
position: relative -> And set the values for top, right, bottom and left properties.
Defines a absolute position for an element.
position: absolute -> And set the values for top, right, bottom and left properties.
Defines a fixed position for an element.
position: fixed -> And set the values for top, right, bottom and left properties.