How To Change Scroll Style In Css Code Example


Example 1: custom scrollbar


body::-webkit-scrollbar {
width: 12px; /* width of the entire scrollbar */
}
body::-webkit-scrollbar-track {
background: orange; /* color of the tracking area */
}
body::-webkit-scrollbar-thumb {
background-color: blue; /* color of the scroll thumb */
border-radius: 20px; /* roundness of the scroll thumb */
border: 3px solid orange; /* creates padding around scroll thumb */
}

Example 2: custom scroll bar


/* 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;
}

Example 3: custom style scrollbar in css


/* Works on Firefox */
* {
scrollbar-width: thin;
scrollbar-color: blue orange;
}

/* Works on Chrome, Edge, and Safari */
*::-webkit-scrollbar {
width: 12px;
}

*::-webkit-scrollbar-track {
background: orange;
}

*::-webkit-scrollbar-thumb {
background-color: blue;
border-radius: 20px;
border: 3px solid orange;
}

Comments

Popular posts from this blog

Converting A String To Int In Groovy

"Cannot Create Cache Directory /home//.composer/cache/repo/https---packagist.org/, Or Directory Is Not Writable. Proceeding Without Cache"

Android How Can I Convert A String To A Editable