scroll bar css code example
Example 1: custom scrollbar
body::-webkit-scrollbar {
width: 12px;
}
body::-webkit-scrollbar-track {
background: orange;
}
body::-webkit-scrollbar-thumb {
background-color: blue;
border-radius: 20px;
border: 3px solid orange;
}
Example 2: css scrollbar
::-webkit-scrollbar {
width: 10px;
}
::-webkit-scrollbar-track {
background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
background: #888;
border-radius:10px;
}
::-webkit-scrollbar-thumb:hover {
background: #555;
}
Example 3: scrollbar css
* {
scrollbar-width: thin;
scrollbar-color: blue orange;
}
*::-webkit-scrollbar {
width: 12px;
}
*::-webkit-scrollbar-track {
background: orange;
}
*::-webkit-scrollbar-thumb {
background-color: blue;
border-radius: 20px;
border: 3px solid orange;
}
Example 4: custom scroll bar
*::-webkit-scrollbar {
width: 10px;
}
*::-webkit-scrollbar-track {
background: #f1f1f1;
}
*::-webkit-scrollbar-thumb {
background: #888;
}
*::-webkit-scrollbar-thumb:hover {
background: #555;
}
Example 5: css vw scrollbar
body {
width: calc(100vw - (100vw - 100%));
}
Example 6: css edit scroll bar
::-webkit-scrollbar{width:6px;border-left:1px solid #E6ECF8;}
::-webkit-scrollbar-thumb{background-color:#d6872c;}