The Awesome Trick of Absolute and Relative Positioning!

There’s an awesome trick when combining absolute and relative positioning in CSS. It works like this:

When a parent element’s position is relative, and a child element’s position is absolute, you can then set the top/left/right/bottom position of the child element, within the container of the parent.

Sample CSS:

.parent {
   position:relative;
}

.son {
  position: absolute;
  top: 15px;
  left: 25px;
}

css-relative-absolute-positioning