I am making a horizontal scrolling component like instagram stories. But I could not figure out how to do it? Here is what i am trying to do:
.scroller{
height: 125px;
width: 300px;
background-color: blue;
overflow-x: scroll;
overflow-y: hidden;
}
.itemContainer{
display: flex;
}
.item{
display: inline-block;
width: 100px;
height: 100px;
background-color: lime;
margin: 5px;
}
<div class="scroller">
<div class="itemContainer">
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
</div>
</div>
I tried using flexbox properties but that could not help. I also tried using block and inline-block elements to make items overflow.