Welcome to Delicate template
Header
Just another WordPress site
Header

用css定义滚动条样式

9月 3rd, 2011 | Posted by 无 名 in css

给div加滚动条

设置高度或宽度,再加滚动条。
style=”width:200px; height:200px; overflow-x:auto;overflow-y:auto;”
隐藏滚动条:
style=”width:200px; height:200px; overflow:hidden;”

自定义滚动条的颜色
样式图:

代码如下:

scrollbar-arrow-color: #f4ae21; /*三角箭头的颜色*/
scrollbar-face-color: #333; /*立体滚动条的颜色*/
scrollbar-3dlight-color: #666; /*立体滚动条亮边的颜色*/
scrollbar-highlight-color: #666; /*滚动条空白部分的颜色*/
scrollbar-shadow-color: #999; /*立体滚动条阴影的颜色*/
scrollbar-darkshadow-color: #666; /*立体滚动条强阴影的颜色*/
scrollbar-track-color: #666; /*立体滚动条背景颜色*/
scrollbar-base-color:#f8f8f8; /*滚动条的基本颜色*/
cursor:url(mouse.cur); /*自定义个性鼠标*/

以上均适用于<body>、<div>、<textarea>、<iframe>
注意在火狐测试看不到颜色的变化。

You can follow any responses to this entry through the RSS 2.0 Both comments and pings are currently closed.