<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>滚动条样式</title>
</head>
<body>
<div class="test">
<div class="scrollbar"></div>
</div>
<style>
.test{width:98%;height:200px;overflow:auto;float:left;margin:5px;border:none}
.scrollbar{width:30px;height:300px;margin:0 auto}
.test::-webkit-scrollbar { width: 8px;height: 1px;} /*高宽分别对应横竖滚动条的尺寸*/
.test::-webkit-scrollbar-thumb {border-radius: 20px;-webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2); background: #4ea8fc;}/*滚动条里面小方块*/
.test::-webkit-scrollbar-track { -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.1);border-radius: 25px;background: #f8f8f8;} /*滚动条里面轨道*/
</style>
</body>
</html>