<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>CSS3自定义滚动条图片版 </title>
<style>
*{
margin: 0;
padding: 0;
}
#container{
width: 100%;
height: 1200px;
line-height: 600px;
text-align: center;
background: #ccc;
}
::-webkit-scrollbar {
width: 16px;
height: 16px;
}
::-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-button:end:increment {
background-image: url(./images/scroll_cntrl_dwn.png);
}
::-webkit-scrollbar-button:start:decrement {
background-image: url(./images/scroll_cntrl_up.png);
}
::-webkit-scrollbar-track-piece:vertical:start {
background-image: url(./images/scroll_gutter_top.png), url(./images/scroll_gutter_mid.png);
background-repeat: no-repeat, repeat-y;
}
::-webkit-scrollbar-track-piece:vertical:end {
background-image: url(./images/scroll_gutter_btm.png), url(./images/scroll_gutter_mid.png);
background-repeat: no-repeat, repeat-y;
background-position: bottom left, 0 0;
}
::-webkit-scrollbar-thumb:vertical {
height: 56px;
-webkit-border-image: url(./images/scroll_thumb.png) 8 0 8 0 stretch stretch;
border-width: 8 0 8 0;
}
</style>
</head>
<body>
<div id="container">CSS3自定义滚动条图片版<br/>请在chrome下看右侧滚动条,其他浏览器没有效果哦</div>
</body>
</html>