I have 3 levels of div:
- (In green below) A top level
divwithoverflow: hidden. This is because I want some content (not shown here) inside that box to cropped if it exceeds the size of the box. - (In red below) Inside this, I have
divwithposition: relative. The only use for this is for the next level. - (In blue below) Finally a
divI take out of the flow withposition: absolutebut that I want positioned relative to the reddiv(not to the page).
I'd like to have the blue box be taken out of the flow and expand beyond the green box, but be positioned relative to the red box as in:

However, with the code below, I get:

And removing the position: relative on the red box, now the blue box is allowed to get out of the green box, but is not positioned anymore relative to the red box:

Is there a way to:
- Keep the
overflow: hiddenon the green box. - Have the blue box expand beyond the green box and be positioned relative to red box?
The full source:
#d1 {
overflow: hidden;
background: #efe;
padding: 5px;
width: 125px;
}
#d2 {
position: relative;
background: #fee;
padding: 2px;
width: 100px;
height: 100px;
}
#d3 {
position: absolute;
top: 10px;
background: #eef;
padding: 2px;
width: 75px;
height: 150px;
}
<br/><br/><br/>
<div id="d1" >
<div id="d2" >
<div id="d3"></div>
</div>
</div>
