CSS Relative Position


Example

Relative positioning moves the element in relation to where it would have been in normal flow .Offset properties:

  1. top
  2. left
  3. right
  4. bottom

are used to indicate how far to move the element from where it would have been in normal flow.

.relpos{
    position:relative;
    top:20px;
    left:30px;
}

This code will move the box containing element with attribute class="relpos" 20px down and 30px to the right from where it would have been in normal flow.