如何更改滚动条的颜色 [英] How to change the color of scrollbars

查看:696
本文介绍了如何更改滚动条的颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Internet Explorer和Firefox中更改我的网页上滚动条的颜色。



此代码创建滚动条:

 < div style =overflow:auto; width:750px; height:400px> 
< / div>

要更改它们的颜色,我尝试了以下代码:

 < STYLE TYPE =text / css> 

BODY
{
scrollbar-base-color:orange;
scrollbar-arrow-color:green;
scrollbar-DarkShadow - 颜色:blue;
}
< / STYLE>

上面的代码在我的头,但它没有改变滚动条的颜色。 p>

任何人都可以帮助我吗?

解决方案

您发布将不能在现代浏览器(IE8,Safari,Firefox等)。因为你试图滚动一个div,但是,你可以选择在Javascript / DHTML中创建一个自定义滚动条。快速的Google搜索显示,有几个人已经做过类似这样的操作: http:// www .hesido.com / web.php?page = customscrollbar


I want to change the color of the scrollbars on my pages in Internet Explorer and Firefox.

This code creates scrollbars:

<div style="overflow: auto; width: 750px; height: 400px">   
</div>

To change their color, I tried this code:

<STYLE TYPE="text/css">

BODY
{
scrollbar-base-color: orange;
scrollbar-arrow-color: green;
scrollbar-DarkShadow-Color: blue;
}
</STYLE>

The above code is in my header, but it didn't change the scrollbars' color.

Can anyone help me?

解决方案

Just as others said, the CSS you posted won't work on modern browsers (IE8, Safari, Firefox, etc). Since you're trying to scroll a div, you do, however, have the option of making a custom scrollbar in Javascript/DHTML. A quick Google search reveals a few have done just that like this one: http://www.hesido.com/web.php?page=customscrollbar

这篇关于如何更改滚动条的颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆