I have a parent div that has overflow-x set to scroll. I'd like an absolutely positioned child-div to be able to completely cover the entire horizontally-scrollable area of its parent. I have tried setting the child top/bottom/left/right edges to 0 or setting its width to 100%, but in both cases it the child div will only cover the initially VISIBLE scrollable area.
HTML:
<div class="outerScroll">
<div class="innerOverlay"> </div>
I would like the blue .innerOverlay div to extend fully to the right of the .outerScroll div
</div>
CSS:
.outerScroll {
overflow-x:scroll;
height:100px;
width:150px;
background-color:rgba(0,0,155,0.5);
white-space: nowrap;
position:relative;
}
.innerOverlay {
position:absolute;
background-color:rgba(155,255,255,0.5);
top:0; left:0; right:0; bottom:0;
}
Here is the fiddle: http://jsfiddle.net/hammerbrostime/4e9zU/