The default value for the position
property is static. It makes the
elements follow the normal flow.
When you set an element's position
to relative,
you can move the element to a new location.
The top
, right
,
bottom
and left
properties are used to
note the distance of the new
location from
the original default location.
In the above example, div3's original position
is directly below div2.
But by setting the position
value to relative
and using left
and top
values,
we have pushed it from the left and top by 100px
from its original position.
The top
and left
properties
wouldn't work if you remove the
position
property. These properties
don't work with the static
position
elements. You can check this by removing the
position
property for div3. Also, try
setting top
,right
, bottom
and left
properties
to div2 to see what happens.