Relative offset property

Hi everyone,

I have a question, so we use position:relative, we have to use offset properties like top, bottom,left&right to position the element.Is this the same when we use margin property for the element ? cause I have seen how the elements are positioned with offset , its kinda similar to using margin properties

Thank you for your help!

Position relates to where the top left corner of the box is. When we change the position offsets, we move the whole box. Even after positioning with offsets we can still apply margins that will be outside of the border of said box content. This means that the position of the content box is offset plus margin. Play with a single element and test this process to satisfy your curiosity.

1 Like

That is so helpful sir , thank you !

1 Like

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.