您的位置:首页 > Web前端 > CSS

webkit scrollbar 样式

2013-11-28 14:16 579 查看
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<style type="text/css">
/* scroll */
::-webkit-scrollbar{ width:10px; height:10px; }
::-webkit-scrollbar-button{ width:0; height:0; }
::-webkit-scrollbar-button:start:decrement,::-webkit-scrollbar-button:end:increment{ display:block; }
::-webkit-scrollbar-button:vertical:start:increment,::-webkit-scrollbar-button:vertical:end:decrement { display:none; }
::-webkit-scrollbar-corner{ display:block; }

::-webkit-scrollbar-thumb{
background-clip:padding-box;
background-color:rgba(0,0,0,.2);
border-radius:8px;
}
::-webkit-scrollbar-thumb:hover{
background-clip:padding-box;
background-color:rgba(0,0,0,.5);
border-radius:8px;
}
::-webkit-scrollbar-track:vertical,::-webkit-scrollbar-thumb:vertical{
border-left:1px solid transparent;
border-right:1px solid transparent;
}
::-webkit-scrollbar-track:horizontal,::-webkit-scrollbar-thumb:horizontal{
border-top:1px solid transparent;
border-bottom:1px solid transparent;
}
::-webkit-scrollbar-track:hover{
background-clip:padding-box;
background-color:rgba(0,0,0,.15);
}
</style>
</head>
<body>

<div style='height:100px;width:200px;overflow:auto;background:#fff;border:1px solid #eee;border-radius:5px'>
<p>hello
<p>hello
<p>hello
<p>hello
<p>hello
<p>hello
<p>hello
<p>hello
<p>hello
</div>

</body>
</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: