Position: Absolute; Position: Relative;
What is CSS Positioning
If you just started learning frontend development, you must have come across the position property and you're wondering what's about. As the name implies, the CSS position property is used to position
an element within a cont...
theaviatorcodes2.hashnode.dev3 min read
Joe Attardi
Veteran Software Developer | Web & Front-End Expert | Author | Tech Writer | Blogger
The section on
position: absoluteis not quite accurate - the element is not necessarily positioned relative to its parent container.An absolutely positioned element is positioned relative to the nearest ancestor (not necessarily direct parent) that has a
positionother thanstatic. Sometimes it can get a little tricky.To make an absolutely positioned element relative to its containing element, you can just set
position: relativeon the parent.