I would like to always have same space-distances on both left and right side of all my flexbox boxes. Currently I have this code:
body
background-color white
margin 0 0
padding 0 0
.overlay
display flex
position absolute
background-color grey
cursor pointer
color #8e3433
flex-flow row nowrap
justify-content flex-start
height 40vh
width 100vw
bottom 0
left 0
margin 0
overflow-y hidden
overflow-x scroll
.overlay .item-image
border-radius 5px
flex 1 1 auto
min-width 45.0vw
width 45.0vw
margin 0 2vw 0 2vw
border 1px solid yellow
Please see this fiddle as an example (if it does not show rightaway you have to select the style code at the end and just press enter (a bug in JSbin...) and it should show up).
On the left of the first box I get 2vh instead of 4vh. See:
Between other boxes it is all fine (4vh). The last box does not have any space on its right side. See:
So my question:
1) how to get 4vh on the left of the first box?; and
2) how to get 4vh on the right of the last box?
I tried looking this up and saw solutions for slightly different issues using padding of the container. I would prefer a solution without adjusting the padding of the container.