How do I add horizontal padding to the scrollbar?

How do I add horizontal padding to the scrollbar?

enter image description here

On the picture, you can see what the scrollbar must look like. It must have a horizontal padding, as if the track with the thumb were 'pushed' inside the scrollbar. How do I achieve such horizontal padding? I assume there must be some way to do it via webkit scrollbar. Everything else is already implemented, I only need the way to add such horizontal padding.

Answer

I assume you want some horizontal space between the image & scrollbar. Try wrapping the image with another container and give it a height and top/bottom padding.

enter image description here

Enjoyed this article?

Check out more content on our blog or follow us on social media.

Browse more articles