Skip to content

Scrollbar

Inju Michorius edited this page May 17, 2021 · 1 revision

It's possible to create a custom scrollbar for your website. To style your scrollbar, you'll need to use the selector ::-webkit-scrollbar. You can change a lot of things, but it's best practise to only change the width of the scrollbar. We get into more styling options below.

/* Scrollbar */
::-webkit-scrollbar {
    width: 1.5rem;
}

Add color to your scrollbar by using the selector below. This will change the color of the track.

/* Track */
::-webkit-scrollbar-track {
    box-shadow: inset 0 0 5px #e4bd34;
    background: #D3AD30;
}

To change the styling of the thing you drag, you'll need this selector. You can add a little spice here and use the pseudo class :hover.

/* Handle */
::-webkit-scrollbar-thumb {
    background: #e4bd34;
}

/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
    background: #907720;
}

Weeks

Week 1 📕

Week 2 📙

CSS Techniques

CSS variables 🧠

Font-face 👁‍🗨

Fonts 🅰️

Keyframes 🥳

Custom everything!

Favicon 🌆

Cursor 🖱️

Scrollbar ⌨️

Selection 🧲

Clone this wiki locally