I have the following where I need the overflow hidden horizontally.
But overflow should be visible vertically.
Having issues where an overflow: hidden on x axis affects y -axis too.
I have tried to specify the axis for over flow as follows but it still hides the y axis.
.container{
.....
overflow-x: hidden;
}
See the screenshots to see what I am trying to achieve.
div.left {
margin-left: 10px;
background:blue;
height:200px;
width:300px;
}
.container{
padding-top: 20px;
margin-top: 10px;
background:black;
height:220px;
width:450px;
overflow: hidden;
}
.container > div {
display: table-cell;
}
.inner {
height: 500px;
background-color: red;
overflow-y: visible;
}
<div class="container">
<div>
<div class="left">
LEFT1
<div class="inner">
INNER
</div>
</div>
</div>
<div>
<div class="left">
LEFT2
</div>
</div>
</div>
Suggestions from from following blogs does not work for this scenario.
https://www.gavsblog.com/blog/only-hide-css-overflow-on-a-single-x-or-y-axis-or-ignore-it https://css-tricks.com/popping-hidden-overflow/
This is what I have now. Current
This is what I am trying to achieve. Expected Result
I can't remove the x-axis overflow cos it would look like this where LEFT2 overflows horizontally which is also incorrect. Removing overflow
Or is there another way to make overflow hidden on the x axis without the use of overflow:hidden ?