Home >Web Front-end >HTML Tutorial >css3中webkit内核的滚动条样式_html/css_WEB-ITnose

css3中webkit内核的滚动条样式_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:38:071152browse

项目当中用到的滚动条样式,在别人的基础上调成适合自己的样式。(IE可以调试滚动条样式,firefox目前不能调试)

::-webkit-scrollbar { width: 14px; }/* Track & scroll thickness */  ::-webkit-scrollbar-track { background-color:#ddd; }/* Track color */  ::-webkit-scrollbar-thumb { background-color: #333;}/* Scroll color */  ::-webkit-scrollbar-thumb:hover { background-color: #000 }/* Scroll hover color */  ::-webkit-scrollbar-thumb:active { background-color: #000 }/* Scroll click & drag color */

分享一下 我的项目中的webkit内核滚动条样式(chrome,sarfrai)
demo:http://codepen.io/tianzi77/pen/mJNPmE

        * { margin: 0; padding: 0; }        div { margin: 20px auto; padding: 10px; width: 500px; height: 600px; border: 1px solid #ddd; }        p { height: 1000px; }        /* 自定义滚动条样式 */        .webkit-scrollbar { overflow: hidden; }        .webkit-scrollbar:hover { overflow-y: scroll; }        .webkit-scrollbar::-webkit-scrollbar { width: 7px; height: 7px; /*设置整个滚动条的宽高*/ }        .webkit-scrollbar::-webkit-scrollbar-track { background-color: transparent; /*整个滚动背景色*/ }        .webkit-scrollbar::-webkit-scrollbar-thumb { background-color: #9e9e9e; /*7px的滚动条背景色*/ border-radius: 7px; border: 1px solid #fff; }        .webkit-scrollbar::-webkit-scrollbar-thumb:hover { background-color: #525252; }

版权声明:本文为博主原创文章,未经博主允许不得转载。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn