I am quite well-versed in HTML and CSS, however, I run into some challenges when setting up multiple hierarchical divs with relative and absolute positions.
My current setup looks like this:
<div id="firstdiv">
<div id="secdiv">
<div id="thirddiv">
<div id="forthdiv">
</div>
</div>
</div>
</div>
Initially, aligning most of the divs using absolute position was simple - by setting #firstdiv to relative position and #secdiv to absolute. However, I encountered difficulties when trying to set #forthdiv as absolute to #thirddiv. Despite setting #thirddiv to relative and #forthdiv to absolute, #forthdiv seems to be relating its position to #firstdiv instead of #thriddiv.
Currently, I am struggling to make absolute positioned divs only consider their direct parent and not the root container. Any suggestions on how to achieve this?