To achieve the desired effect of overlapping without using position: absolute;
, and considering that iframe
is not an option, you can try setting up the parent and child elements as shown below:
<div id='parent' style="width: 200px; height: 200px; background-color: yellowgreen;">
<div id='child-1' style="width: 100%; height: 100%; background-color: orange; opacity: 0.5;"></div>
<div id='child-2' style="width: 100%; height: 100%; background-color: dimgray; opacity: 0.5;"></div>
</div>
The expected outcome based on the code provided would be a single 200x200 square with a blend of yellow-green, orange, and dimgray colors at 50% opacity, similar to the image linked here: https://i.sstatic.net/fzfzosK6.png.