DEV Community

Cover image for CSS position absolute versus relative easy way!
Jahid Iqbal
Jahid Iqbal

Posted on

CSS position absolute versus relative easy way!

CSS position property

CSS position property determines the positioning of an element and also plays an important role of how the element will be displayed in the browser.

Absolute position

In absolute position, an element changes the positions and layout with respect to its parent. If it didn’t find any parent then it will use the document body.

Relative position

In Relative position, an element changes its position within its current position without affecting the layout.

Top comments (0)