I am trying to create a horizontal scrolling container. Every thing is working fine but i can't seem to be able to induce the margin on last element of the container,
Here's the pen,
https://codepen.io/mercurial_providence/pen/ZEEeGqR
<div class="container">
<div class="content full-width">
<div class="item">ITEM</div>
...
<div class="item">ITEM</div>
</div>
</div>
And the CSS,
.container{
width:80%;
margin-left:9%;
background:blue;
height:200px;
position:absolute;
.content{
display:flex;
flex-direction:row;
overflow:auto;
}
.full-width {
left: 50%;
margin-left: -50vw;
margin-right: -50vw;
max-width: 100vw;
position: relative;
right: 50%;
width: 100vw;
> :first-child{
margin-left: 5vw;
}
> :last-child{
margin-right: 300vw;
}
}
}
.item{
min-height:92px;
min-width:92px;
background:cyan;
margin:4px;
}