{"id":304986,"date":"2020-03-15T07:03:20","date_gmt":"2020-03-15T14:03:20","guid":{"rendered":"https:\/\/css-tricks.com\/?post_type=chapters&p=304986"},"modified":"2021-10-06T07:51:15","modified_gmt":"2021-10-06T14:51:15","slug":"scroll-indicator","status":"publish","type":"chapters","link":"https:\/\/css-tricks.com\/books\/greatest-css-tricks\/scroll-indicator\/","title":{"rendered":"Scroll Indicator"},"content":{"rendered":"\n

There is a built-in browser feature for indicating your scroll position. Get this: it’s the scrollbar, and it does a great job. There is even a standardized way to style scrollbars these days. <\/p>\n\n\n\n

body {\n  --scrollbarBG: #CFD8DC;\n  --thumbBG: #90A4AE;\n\n  scrollbar-width: thin;\n  scrollbar-color: var(--thumbBG) var(--scrollbarBG);\n}<\/code><\/pre>\n\n\n\n

You might want to combine those with -webkit-<\/code> styles<\/a> for the best browser support. For example:<\/p>\n\n\n\n