question about css position: absolute
https://code.sololearn.com/W21wQCbg236p/#css in this code, blue square is underneath the red square, 100% overlapped. Blue one is position:absolute, red one is position:relative. Why this happened? I didn't write anything about margins... https://code.sololearn.com/WdqR4QKmdT3i/#html In this code, I changed the blue square's position to relative. This time the squares are not overlapping. (both divs are positioned relative.) I learned that " An element with position: absolute; is positioned relative to the nearest positioned ancestor " The 'ancestor', what does it actually mean? It doesn't have to be parent-child relationship? Can it be just placed next to each other like this? <div class="blue">Blue</div> <div class="red">Red</div> Div class="blue" is written ""before"" div class="red" but the blue one's position(absolute) gets affect from the red one(relative) ?