Lets say I have a div with a height of 10 000px. Since the div's height is bigger than the viewport of the user, the browser will show the scrollbar. I am wondering if I can hide the scrollbar but still be able to scroll through the div.
I tried using overflow-y: hidden;
and height: 100vh;
on the parent div, however, this doesn't allow me to scroll.
As you can see, in the snippet below the scrollbar is hidden but I can't scroll in order to see the third image.
.parent {
background-color: red;
overflow-y: hidden;
height: 100vh;
}
<div class='parent'>
<img src='https://images.pexels.com/photos/617278/pexels-photo-617278.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500'>
<img src='https://images.pexels.com/photos/617278/pexels-photo-617278.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500'>
<img src='https://images.pexels.com/photos/617278/pexels-photo-617278.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500'>
</div>