I have a rather weird scenario that I was wondering if it would be possible to overcome.
I have a HTML block element with fixed dimensions which is also styled as "overflow:hidden
". I want to position a div which is nested-child of this element at a certain offset. The child div has the same dimensions as its parent. Since the parent is "overflow:hidden" it clips the child div whenever overflows its boundaries. Is there a way to prevent this clipping with some intelligent CSS trickery?
<div style="background-color:RED; width:100px; height:100px; overflow: hidden; position: relative;">
<!-- Notice the child is 100 x 100 px and is clipped by the parent's overflow:hidden; styling-->
<div style="background-color:BLUE; width:100px; height:100px; position: absolute; top: 70px;left: 70px; z-index: 1000;"></div>
</div>
I am limited by certain constraints and cannot loose the "overflow:hidden;"
setting on the parent or break the parent-child DOM relationship between the two elements. Positioning the child as "position:fixed" is also not an option.
Here's the link to JSFiddle that shows the problem.