。。纯Css3滚动条在IE和Firefox中不起作用。。任何人可以调整,使它可以与上述浏览器工作。这里是代码和小提琴(请在Chrome,Firefox和IE中查看)
Html
<div class="scrollbar" id="ex3">
<div class="content">Example 3</div>
</div> CSS
.scrollbar{
width:150px;
height:300px;
background-color:lightgray;
margin-top:40px;
margin-left:40px;
overflow-y:scroll;
float:left;
}
.content{
height:450px;
}
#ex3::-webkit-scrollbar{
width:16px;
background-color:#cccccc;
}
#ex3::-webkit-scrollbar-thumb{
background-color:#B03C3F;
border-radius:10px;
}
#ex3::-webkit-scrollbar-thumb:hover{
background-color:#BF4649;
border:1px solid #333333;
}
#ex3::-webkit-scrollbar-thumb:active{
background-color:#A6393D;
border:1px solid #333333;
}
#ex3::-webkit-scrollbar-track{
border:1px gray solid;
border-radius:10px;
-webkit-box-shadow:0 0 6px gray inset;
} FIDDLE
发布于 2014-03-20 23:23:37
仅仅使用CSS3,它肯定还不能兼容所有的浏览器,尤其是IE。它与边界半径等有相同的效果。
此外,仅仅通过使用::-webkit-scrollbar,显然它只适用于webkit浏览器,如google chrome、safari..
我建议你使用JS插件。推荐使用jScrollPane!http://jscrollpane.kelvinluck.com/basic.html
https://stackoverflow.com/questions/22537092
复制相似问题