I want to slide in a div on a mobile device with a couple of boxes without the box element being sliced off during the slide-in animation, how can I achieve this with CSS? I have the below code and Jsfiddle link: https://jsfiddle.net/dealwap/prwdm724/. The issue happens only on mobile devices.
HTML:
.box {
flex: 0 0 80px;
height: 80px;
background-color: red;
margin: 10px;
left: 10px;
}
.container{
z-index: 10;
width: 100%;
position: relative;
display: flex;
justify-content: flex-start;
margin: auto;
overflow: auto;
-ms-overflow-style: none;
scrollbar-width: none;
animation: 2s ease-in-out 0s 1 slideInFromLeft;
}
@keyframes slideInFromLeft {
0% {
transform: translateX(-100%);
}
100% {
transform: translateX(0);
}
}
<div class="container">
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
</div>