CSS Position

Here are a few examples showing the use of the CSS absolute and relative position properties.

A key feature when using position:absolute is when the parent is position:relative the absolute child element can be positioned within the coordinate space of the parent. Effectively this means you can position the child by setting it’s left and top properties. The child element will position from it’s upper left corner relative to the upper left corner of the parent.

For example setting the child to left:0 and top:0 would place the child object so that it’s upper left corner was aligned with the upper corner of the parent.


Leave a Reply

Your email address will not be published. Required fields are marked *