I have this code and I'm okay with it. But I have a problem with scrolling.
I want to give a width to the .b
class and I want horizontal scroll.
I try to add this code to the .b
class:
width: 500px;
overflow-x: scroll;
But it doesn't work. Is there a bug with flex wrap-reverse with scrolling?
This is an interesting case I think. Any idea for this problem?
NOTE: I need the orange boxes exactly where they are now. I cannot change order or wrap positions. I only need horizontal scroll.
.a {
width: 100%;
}
.b {
display: flex;
flex-direction: column;
flex-wrap: wrap-reverse;
height: 600px;
align-content: flex-start;
width: 500px;
overflow-x: scroll;
}
.c {
width: 200px;
height: 200px;
background: orange;
}
.w {
width: 200px;
margin: 5px;
}
span {
display: block;
}
<div class="a">
<div class="b">
<div class="w">
<span>AAAA</span>
<span>1</span>
<div class="c">
</div>
</div>
<div class="w">
<span>AAAA</span>
<span>2</span>
<div class="c">
</div>
</div>
<div class="w">
<span>AAAA</span>
<span>3</span>
<div class="c">
</div>
</div>
<div class="w">
<span>AAAA</span>
<span>4</span>
<div class="c">
</div>
</div>
<div class="w">
<span>AAAA</span>
<span>5</span>
<div class="c">
</div>
</div>
</div>
</div>