I have a div (blue square) that is positioned as absolute on the page in the parent element (red box), and I need the overflow-y set to hidden, so that it causes the overflowed content on the y axis to be chopped off, but I want so that any content that overflows-x is visible.
HTML:
<div id="box1"> <div id="box2"> <div style="width:200px;height:640px;background:red;position:relative;"> <div style="width:200px;height:200px;background:blue;position:absolute;left:200px;top:100px;"></div> </div> </div> </div>
and CSS:
#box1 { position:absolute; top:0; left:0; bottom:0; width:200px; overflow-y: hidden; border: green 10px solid; } #box2 { width: 200px; overflow-x: visible; }
Here's the script: http://jsfiddle.net/3dhdy9e9/12/
After reading some articles on the topic / questions about stack overflow, obviously, overflow becomes overridden with scroll if the hidden one is applied to the same DOM element, so I split the code to use box1 and box2 .
Basically, I want the green box to be a container that made the contents hide on the Y axis, but allow the contents to be displayed on the X axis in the screenshot:

I can not see the blue box because it is disabled hidden from overflow Y, although the child is set to visible / automatic ...
The green box MUST be limited to a width of 200 pixels so that the content below its height is turned off and the blue box should flow (in absolute position) without affecting the width of the green box (which will work fine if I remove the overflow hidden).
source share