I have a specific layout configuration:
<div id="container">
<div class="left"> 1 </div>
<div class="left"> 1 </div>
<div class="right"> 2 </div>
</div>
My goal is to stack the left
divs on top of each other using position:absolute
, which is working correctly.
In addition, I aim to position the right
div to the far right by adding right:0
, which is also functioning as intended.
The issue arises when the left
and right
divs overlap. My desired outcome is for the left div not to overlap with the content of the right div.
It is important to note that I am unable to assign a fixed width to either div.
To see this problem illustrated visually, please refer to the following jsFiddle.
Below is my current CSS setup:
#container {
width:100%;
position:relative;
}
.left {
position:absolute;
background:yellow;
}
.right {
position:absolute;
background:green;
right:0;
}