JSFiddle - React, Tailwind, and code Playground
by Dhanck
HTML
<div class="card-panel">
<i class="fas fa-chevron-left"></i>
<i class="fas fa-chevron-right"></i>
<div class="inline-cards">
<div class="card-item">
<img src="https://images.unsplash.com/photo-1553388469-94f50e9e0fbb?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=60" />
</div>
<div class="card-item">
<img src="https://images.unsplash.com/photo-1553388469-94f50e9e0fbb?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=60" />
</div>
<div class="card-item">
<img src="https://images.unsplash.com/photo-1553388469-94f50e9e0fbb?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=60" />
</div>
<div class="card-item">
<img src="https://images.unsplash.com/photo-1553388469-94f50e9e0fbb?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=60" />
</div>
<div class="card-item">
<img src="https://images.unsplash.com/photo-1553388469-94f50e9e0fbb?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=60" />
</div>
</div>
</div>
CSS
.card-panel {
width: 450px;
overflow-x: auto;
overflow-y: hidden;
margin: 10px;
}
.fa-chevron-left {
position: absolute;
left: 18px;
background: #9c9c9c2e;
padding: 138px 30px;
}
.fa-chevron-right {
position: absolute;
right: 18px;
background: #9c9c9c2e;
padding: 138px 30px;
}
.fa-chevron-right:hover {
background: #9c9c9c94;
cursor: pointer;
}
.inline-cards {
display: block;
}
.card-item {
width: 400px;
height: 250px;
margin: 20px 25px;
border-radius: 0 !important;
box-shadow: 0 0 10px 0 rgba(0, 0, 0, .5);
display: inline-block;
overflow: hidden;
}
::-webkit-scrollbar {
width: 14px;
height: 14px
}
::-webkit-scrollbar-thumb {
height: 6px;
border: 4px solid #002856;
background-clip: padding-box;
border-radius: 12px;
background-color: #002856
}
::-webkit-scrollbar-button {
width: 0;
height: 0;
display: none
}
::-webkit-scrollbar-track {
border: none;
border-radius: 12px
}