To position absolute but relative to parent with CSS, we set the position property.
For instance, we write
#father {
position: relative;
}
#son1 {
position: absolute;
top: 100%;
}
to set the parent element to have relative position with position: relative;
.
Then we set the child to have absolute position with position: absolute;
, which will position it relative to the parent.