CSS scrollbar-color attribute
- Previous Page scroll-snap-type
- Next Page shape-outside
Definition and Usage
scrollbar-color
The attribute specifies the color of the scrollbar track (background) and the slider (scrollbar).
Example
Sets the color of the element's scrollbar:
div.scroller { width: 300px; height: 100px; overflow-y: scroll; scrollbar-color: pink lightblue; }
CSS Syntax
scrollbar-color: auto|color color;
Attribute Value
Value | Description |
---|---|
auto | Sets the color of the scrollbar in the browser. Default value. |
color color | The first color sets the color of the scrollbar slider, the second color sets the color of the scrollbar track. |
initial | Sets this property to its default value. See: initial. |
inherit | Inherits this property from its parent element. See: inherit. |
Technical Details
Default Value: | auto |
---|---|
Inheritance: | yes |
Animation Production: | Not supported. See:Animation-related Properties. |
Version: | CSS Scrollbars Styling Module Level 1 |
JavaScript Syntax: | object.style.scrollbarColor="red blue" |
Browser Support
The numbers in the table indicate the browser version that first fully supports this attribute.
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
121 | 121 | 64 | Not Supported | 107 |
- Previous Page scroll-snap-type
- Next Page shape-outside