CSS Scrollbars - CSS: Cascading Style Sheets 编辑
Experimental
This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
CSS Scrollbars standardizes the obsolete scrollbar color properties introduced in 2000 by Windows IE 5.5.
Basic Example
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;
}
HTML
<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>
Result
Reference
CSS Properties
Specifications
Specification | Status | Comment |
---|---|---|
CSS Scrollbars Level 1 | Working Draft | Initial definition. |
Accessibility concerns
When you customize scrollbars, consider they have enough contrast and that their hit area is large enough for people who use touch input.
Browser compatibility
scrollbar-width
BCD tables only load in the browser
scrollbar-color
BCD tables only load in the browser
See also
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论