I've got the bx-slider that has overflow:hidden on its wrapper. My layout dictates, that one element should break out of the box and lay above the top edge.
Does not sound hard at all - thats what overflow-y and x is for. I thought. But no matter what I do, once I set one of the values to hidden, the other (x or y) is hidden too.
I've made a testcase which simulates the slider. I want only the grey element to be displayed in full size out of the wrapper box. The next elements should not be displayed until they flow into the viewport.
.wrapper {
margin: 50px auto;
width:400px;
overflow-x:hidden;
}
.sliderContainer {
width:1400px;
}
.sliderElement {
width:400px;
height:200px;
background-color:red;
display:inline-block;
margin-right:50px;
}
.breakoutElement {
width:50px;
height:50px;
background-color:grey;
margin: -25px auto 0 auto;
}
<div class="wrapper">
<div class="sliderContainer">
<div class="sliderElement">
<div class="breakoutElement"></div>
</div>
<div class="sliderElement"></div>
<div class="sliderElement"></div>
</div>
</div>