如何使用CSS更改浏览器的滚动条颜色? [英] How do I change the browser's scrollbar colours using CSS?
问题描述
从 Google搜索结果页面,我看到的示例只在IE和Opera上运行。
有什么办法可以在所有浏览器中一致地执行此操作吗?
此外,浏览器的主滚动条整个页面)和滚动条在一个文本区域与页面?
您可以在内创建自己的滚动条一个使用CSS和JavaScript的组合的页面。请参见 http://stackoverflow.com/questions/780674/scroll-bar-with-images 。
但是,在页面外部的滚动条的呈现取决于浏览器。
WebKit 最近添加了为默认滚动条设置样式的能力,但这仍然
:看起来 MooScroll 已经管理,以替换浏览器的主滚动条,告诉它没有什么可滚动,然后创建自己的滚动条在最右边的窗口。聪明!Steve
From the Google Results page, the examples I saw were working only in IE and one case in Opera.
Is there any way this can be done consistently across all browsers?
Also, is there a difference between the main scrollbar of the browser (which appears across the whole page) and the scrollbar in a text area withing the page? Can I manipulate only the latter if not the former?
You can create your own scrollbars within a page using a combination of CSS and JavaScript. See http://stackoverflow.com/questions/780674/scroll-bar-with-images.
However, rendering of the scrollbar outside the page is up to the browser.
WebKit recently added the ability to style the default scrollbars, but this still only applies within the page.
EDIT: It seems that MooScroll has managed to 'replace' the browser's main scrollbar by telling it there's nothing to scroll and then creating their own scrollbar at the right-most side of the window. Clever!
Steve
这篇关于如何使用CSS更改浏览器的滚动条颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!