DEV Community

Cover image for Custom ScrollBars
Gaurish Sethia
Gaurish Sethia

Posted on • Updated on

Custom ScrollBars

Well,

So in my early stages of web dev, I built a few websites that had very long pages, I was into a big thought that this kinda you know the grey scroll bar sucks because it was grey and my whole design being good and this scroll bar grey made me customize the scrollbar.

I searched on google how to do it and i hardly found any.

So i would like to help beautiful people who came here with this code snippet.
Enjoy!

body::-webkit-scrollbar {
  /* Required for Base of the bar for basically for setting the width ;)  */
}

body::-webkit-scrollbar-track {
  /* the "track" of the bar, For Customizing The Background! */
}

body::-webkit-scrollbar-thumb {
  /* the actual draggable element! */
}
Enter fullscreen mode Exit fullscreen mode

Top comments (0)