I successfully implemented a grid layout for displaying four book images in a row with CSS, including responsive overflow. However, the challenge lies in ensuring that only one row scrolls at a time while allowing other rows to scroll simultaneously when overflowing. Below is a snippet of my code:
.book-section-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
grid-column-gap: 3rem;
grid-row-gap: 5.5rem;
width: 90%;
margin: auto;
overflow: auto;
}
.book-section-grid>div img {
width: 100%;
}
<div class="book-section-grid">
<div>
<img src="https://via.placeholder.com/220x312/b3d7ff/FFFFFF/?text=Book-A" alt="">
<h4>Photographer’s trouble shooter</h4>
<span>by <a href="#">Michael Freeman</a></span>
</div>
(More image and text elements...)
</div>
Is it possible to incorporate JavaScript to achieve this functionality?