Position

Positioning elements

Css allows to define exactly where an element should be rendered.

The possible values are.

PropertiesDescription
staticcorresponding to the normal flow (default)
relativethe element participates in normal flow but rendered with an offset relative to its normal position. After this translation, the element can overlap other elements
absoluteThe element is eliminated from the normal flow and is rendered with an offset relative to the first positioned parent element
fixedThe 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.
Notes
Note
- The element is positioned when the 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 properties
PropertiesDescription
top
right
bottom
left

The possible values are

PropertiesDescription
<length>
<percentage>
auto
inherit
Relative Positioning

Defines a relative position for an element.

position: relative -> And set the values for top, right, bottom and left properties.

Absolute Positioning

Defines a absolute position for an element.

position: absolute -> And set the values for top, right, bottom and left properties.

Fixed Positioning

Defines a fixed position for an element.

position: fixed -> And set the values for top, right, bottom and left properties.

Related Tutorial
Follow Us
https://www.facebook.com/Rookie-Nerd-638990322793530 https://twitter.com/RookieNerdTutor https://plus.google.com/b/117136517396468545840 #
Contents +