How to Style Scrollbars in CSS
You can style different parts of a scrollbar in webkit browser, using the below selectors:
Copied to clipboard!
// Change style of scrollbars with the// ::-webkit-scrollbar pseudo elements
::-webkit-scrollbar {
width: 5px;
}
::-webkit-scrollbar-track {
background: #282e3b;
}
::-webkit-scrollbar-thumb {
background: #fff;
}
Keep in mind that support for scrollbar
is really low when using it unprefixed. This is because the specification is still in working draft.
Resources:
π More Webtips
Rocket Launch Your Career
Speed up your learning progress with our mentorship program. Join as a mentee to unlock the full potential of Webtips and get a personalized learning experience by experts to master the following frontend technologies:
Courses
CSS - The Complete Guide (including Flexbox, Grid and Sass)
Including Flexbox, Grid, and Sass
Whether you're learning CSS for the first time or brushing up on your CSS skills and diving even deeper, this course is for you. Every web developer has to know CSS.
The HTML & CSS Bootcamp
From Zero to Expert!
This course covers flexbox, CSS grid, animations, responsive design, and much more! You will find tons of exercises & projects inside this course.
The Creative HTML5 & CSS3 Course
Build Awesome Websites
Learn HTML5 and CSS3 by creating three amazing, well-designed and animated websites from scratch.