//=== https://stackoverflow.com/questions/10487292/position-absolute-but-relative-to-parent
#father {
position: relative;
}
#son1 {
position: absolute;
top: 0;
}
#son2 {
position: absolute;
bottom: 0;
}
This works because position: absolute means something like "use top, right, bottom, left to position yourself in relation to the nearest ancestor who has position: absolute or position: relative."
If you don't give any position to parent then by default it takes "static"
//===
沒有留言:
張貼留言