Home › Forums › CSS › confused about ‘relative’ and ‘absolute’ position ! › Re: confused about ‘relative’ and ‘absolute’ position !
Element with relative position: if it has TOP, BOTTOM, LEFT and/or RIGHT values, then its position will be shifted that much from it’s original position. Example: if it has top:-10px
, it will be placed 10 pixels higher compared to its original position. Or, if it has left:20px
, it will be moved 20 pixels to the right.
Element with absolute position: will be positioned with the coordinates it has been given (TOP, BOTTOM, LEFT and/or RIGHT), with the zero point being in the top left corner of the nearest parent that has position relative. Example, if it has left:0; top:0;
, it will be placed at the top left of the nearest relative parent.
These are the basics that keep me sane about this, hope it helps you.