DEV Community

Cover image for How to turn off the relative positioning of an element in CSS?
MELVIN GEORGE
MELVIN GEORGE

Posted on • Originally published at melvingeorge.me

How to turn off the relative positioning of an element in CSS?

Originally posted here!

To turn off the relative positioning of an element in CSS, you can set the position property of that element to static, this will attach that element back to the whole document flow.

/* Turn off relative positioning */
position: static;
Enter fullscreen mode Exit fullscreen mode
  • This is useful in the cases where we want to revert the positioning of an element used with position: absolute; property back to its original document flow.

Feel free to share if you found this useful ๐Ÿ˜ƒ.


Top comments (0)