How TO - Custom Scrollbar

Clash Royale CLAN TAG#URR8PPP <!--
main_leaderboard, all: [728,90][970,90][320,50][468,60]-->
How TO - Custom Scrollbar
❮ Previous
Next ❯
Learn how to create a custom scrollbar with CSS.
Custom Scrollbars
Try it Yourself »
Try it Yourself »
Custom scrollbars are not supported in Firefox or IE/Edge.
How To Create Custom Scrollbars
Webkit browsers, such as Chrome, Safari and Opera, supports the non-standard ::-webkit-scrollbar pseudo element, which allows us to modify the look of the browser's scrollbar.
The following example creates a thin (10px wide) scrollbar, which has a grey track/bar
color and a dark-grey (#888) handle:
Example
/* width */
::-webkit-scrollbar
width: 10px;
/* Track */
::-webkit-scrollbar-track
background: #f1f1f1;
/* Handle */
::-webkit-scrollbar-thumb
background: #888;
/* Handle on hover */
::-webkit-scrollbar-thumb:hover
background: #555;
Try it Yourself »
This example creates a scrollbar with box shadow:
Example
/* width */
::-webkit-scrollbar
width: 20px;
/* Track */
::-webkit-scrollbar-track
box-shadow: inset 0 0 5px
grey;
border-radius: 10px;
/* Handle */
::-webkit-scrollbar-thumb
background: red;
border-radius: 10px;
Try it Yourself »
Scrollbar Selectors
For webkit browsers, you can use the following pseudo elements to customize the browser's scrollbar:
::-webkit-scrollbarthe scrollbar::-webkit-scrollbar-buttonthe buttons on the scrollbar (arrows pointing upwards and downwards).::-webkit-scrollbar-thumbthe draggable scrolling handle.::-webkit-scrollbar-trackthe track (progress bar) of the scrollbar.::-webkit-scrollbar-track-piecethe track (progress bar) NOT covered by the handle.::-webkit-scrollbar-cornerthe bottom corner of the scrollbar, where both horizontal and veritcal scrollbars meet.::-webkit-resizerthe draggable resizing handle that appears at the bottom corner of some elements.
❮ Previous
Next ❯