property

Scrollbar color — CSS reference

Sets thumb color followed by track color, or auto for UA defaults. Choose sufficient contrast and respect forced colors. This affects scrollbar styling, not the scrolling mechanism or layout dimensions.

Formal Syntax & Structure

css syntaxcss
scrollbar-color: #334155 #e2e8f0;

Working Example

Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>scrollbar-color</title><style>body{margin:0}#a{padding:8px;background:rgb(232,237,241);color:rgb(0,0,0);box-sizing:border-box}#outer{width:250px;height:200px;overflow:auto}#s{width:200px;height:100px;overflow:auto}#a{height:300px;width:320px}#s{scrollbar-color:#334155 #e2e8f0}</style><body><div id="outer" tabindex="0" aria-label="Outer scroll region"><div id="s" tabindex="0" aria-label="Inner scroll region"><div id="a">Scroll here, then reach the boundary.</div></div><div style="height:500px">Outer content</div></div></body></html>
CSS Reference