这是
实验性技术
检查
浏览器兼容性表格
要小心谨慎在生产中使用这之前。
CSS Scrollbars standardizes the obsolete scrollbar color properties introduced in 2000 by Windows IE 5.5.
In this example we have chosen to use a thin scrollbar, with a green track and purple thumb.
.scroller {
width: 300px;
height: 100px;
overflow-y: scroll;
scrollbar-color: rebeccapurple green;
scrollbar-width: thin;
}
<div class="scroller"> Veggies es bonus vobis, proinde vos postulo essum magis kohlrabi welsh onion daikon amaranth tatsoi tomatillo melon azuki bean garlic. Gumbo beet greens corn soko endive gumbo gourd. Parsley shallot courgette tatsoi pea sprouts fava bean collard greens dandelion okra wakame tomato. Dandelion cucumber earthnut pea peanut soko zucchini. </div>
| 规范 | 状态 | 注释 |
|---|---|---|
| CSS Scrollbars Level 1 | 工作草案 | 初始定义。 |
When you customize scrollbars, consider they have enough contrast and that their hit area is large enough for people who use touch input.
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
scrollbar-width
|
Chrome 不支持 No | Edge 不支持 No |
Firefox
完整支持
64
|
IE 不支持 No | Opera 不支持 No | Safari 不支持 No | WebView Android 不支持 No | Chrome Android 不支持 No |
Firefox Android
完整支持
64
|
Opera Android 不支持 No | Safari iOS 不支持 No | Samsung Internet Android 不支持 No |
完整支持
不支持
用户必须明确启用此特征。
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
scrollbar-color
|
Chrome 不支持 No | Edge 不支持 No |
Firefox
完整支持
64
注意事项
|
IE 不支持 No | Opera 不支持 No | Safari 不支持 No | WebView Android 不支持 No | Chrome Android 不支持 No |
Firefox Android
完整支持
64
|
Opera Android 不支持 No | Safari iOS 不支持 No | Samsung Internet Android 不支持 No |
完整支持
不支持
见实现注意事项。
用户必须明确启用此特征。