I'm trying to not use Javascript on this. I have a list of boxes with same width but the first child has a different height;
I'm using flex to display the list in a row so I can scroll horizontally between the boxes. But in mobile resolution, I want flex to put the first element on a top row, and the rest on a second row.
I could achive if I set the flex-flow to wrap, but then I loose the scrolling. The closest thing I could find was this, but doesn't have horizontall scroll.
Jsfiddle Demo approach From CSS flex, how to display one item on first line and two on the next line
.section {
display:flex;
flex-flow: row nowrap;
overflow-x: auto;
overflow-y: hidden;
}
.home_box{
flex: 0 0 auto;
width:60%;
height: 300px;
background-color: #abc;
margin: 20px;
}
.home_box:first-child{
height: 600px;
}
<div class="section menu_section_1">
<div class="home_box box_2"></div>
<div class="home_box box_2"></div>
<div class="home_box box_2"></div>
<div class="home_box box_2"></div>
<div class="home_box box_2"></div>
<div class="home_box box_2"></div>
</div>