I have a flex container that is 100% width with a horizontal scroll. I want to have space on left and right in the scroll, but margin-right of the divs doesn't create space on the right side, also I have another container wrapping the container to hide the scrollBar with padding-bottom.
I know that I can use white-space: nowrap in a block container in which margin-right works, but I want to use flex-box. Also I am setting the divs' width with min-width:
Also I know that in this case min-width: 22% = 22vw, but I want to do it with percantage.
jsfiddle code open
body{
width: 100%;
height: 10vh;
margin: 0;
}
div{
height: 100%;
}
.container{
width: 100%;
}
.container > div{
overflow-y: hidden;
display: flex;
width: 100%;
}
.container > div > div{
min-width: 20%;
display: inline-block;
margin: 0 5px;
background: red;
}