自定义滚动条样式纯(css)
啥都不说先看图:

注: 只适合chrom,不适用IE和fireFox
下面展示代码:
<html lang="en">
<head>
<meta charset="UTF-8">
<title>CSS3自定义滚动条-轩枫阁</title>
<style>
header
{
font-family: 'Lobster', cursive;
text-align: center;
font-size: 25px;
} #info
{
font-size: 18px;
color: #;
text-align: center;
margin-bottom: 25px;
} a{
color: #074E8C;
} .scrollbar
{
margin-left: 30px;
float: left;
height: 300px;
width: 65px;
background: #F5F5F5;
overflow-y: scroll;
margin-bottom: 25px;
} .force-overflow
{
min-height: 450px;
} #wrapper
{
text-align: center;
width: 500px;
margin: auto;
} /*
* STYLE 1
*/ #style-::-webkit-scrollbar-track
{
-webkit-box-shadow: inset 6px rgba(,,,0.3);
border-radius: 10px;
background-color: #F5F5F5;
} #style-::-webkit-scrollbar
{
width: 12px;
background-color: #F5F5F5;
} #style-::-webkit-scrollbar-thumb
{
border-radius: 10px;
-webkit-box-shadow: inset 6px rgba(,,,.);
background-color: #;
} /*
* STYLE 2
*/ #style-::-webkit-scrollbar-track
{
-webkit-box-shadow: inset 6px rgba(,,,0.3);
border-radius: 10px;
background-color: #F5F5F5;
} #style-::-webkit-scrollbar
{
width: 12px;
background-color: #F5F5F5;
} #style-::-webkit-scrollbar-thumb
{
border-radius: 10px;
-webkit-box-shadow: inset 6px rgba(,,,.);
background-color: #D62929;
} /*
* STYLE 3
*/ #style-::-webkit-scrollbar-track
{
-webkit-box-shadow: inset 6px rgba(,,,0.3);
background-color: #F5F5F5;
} #style-::-webkit-scrollbar
{
width: 6px;
background-color: #F5F5F5;
} #style-::-webkit-scrollbar-thumb
{
background-color: #;
} /*
* STYLE 4
*/ #style-::-webkit-scrollbar-track
{
-webkit-box-shadow: inset 6px rgba(,,,0.3);
background-color: #F5F5F5;
} #style-::-webkit-scrollbar
{
width: 10px;
background-color: #F5F5F5;
} #style-::-webkit-scrollbar-thumb
{
background-color: #;
border: 2px solid #;
} /*
* STYLE 5
*/ #style-::-webkit-scrollbar-track
{
-webkit-box-shadow: inset 6px rgba(,,,0.3);
background-color: #F5F5F5;
} #style-::-webkit-scrollbar
{
width: 10px;
background-color: #F5F5F5;
} #style-::-webkit-scrollbar-thumb
{
background-color: #0ae; background-image: -webkit-gradient(linear, , %,
color-stop(., rgba(, , , .)),
color-stop(., transparent), to(transparent));
} /*
* STYLE 6
*/ #style-::-webkit-scrollbar-track
{
-webkit-box-shadow: inset 6px rgba(,,,0.3);
background-color: #F5F5F5;
} #style-::-webkit-scrollbar
{
width: 10px;
background-color: #F5F5F5;
} #style-::-webkit-scrollbar-thumb
{
background-color: #F90;
background-image: -webkit-linear-gradient(45deg,
rgba(, , , .) %,
transparent %,
transparent %,
rgba(, , , .) %,
rgba(, , , .) %,
transparent %,
transparent)
} /*
* STYLE 7
*/ #style-::-webkit-scrollbar-track
{
-webkit-box-shadow: inset 6px rgba(,,,0.3);
background-color: #F5F5F5;
border-radius: 10px;
} #style-::-webkit-scrollbar
{
width: 10px;
background-color: #F5F5F5;
} #style-::-webkit-scrollbar-thumb
{
border-radius: 10px;
background-image: -webkit-gradient(linear,
left bottom,
left top,
color-stop(0.44, rgb(,,)),
color-stop(0.72, rgb(,,)),
color-stop(0.86, rgb(,,)));
} /*
* STYLE 8
*/ #style-::-webkit-scrollbar-track
{
border: 1px solid black;
background-color: #F5F5F5;
} #style-::-webkit-scrollbar
{
width: 10px;
background-color: #F5F5F5;
} #style-::-webkit-scrollbar-thumb
{
background-color: #;
} /*
* STYLE 9
*/ #style-::-webkit-scrollbar-track
{
-webkit-box-shadow: inset 6px rgba(,,,0.3);
background-color: #F5F5F5;
} #style-::-webkit-scrollbar
{
width: 10px;
background-color: #F5F5F5;
} #style-::-webkit-scrollbar-thumb
{
background-color: #F90;
background-image: -webkit-linear-gradient(90deg,
rgba(, , , .) %,
transparent %,
transparent %,
rgba(, , , .) %,
rgba(, , , .) %,
transparent %,
transparent)
} /*
* STYLE 10
*/ #style-::-webkit-scrollbar-track
{
-webkit-box-shadow: inset 6px rgba(,,,0.3);
background-color: #F5F5F5;
border-radius: 10px;
} #style-::-webkit-scrollbar
{
width: 10px;
background-color: #F5F5F5;
} #style-::-webkit-scrollbar-thumb
{
background-color: #AAA;
border-radius: 10px;
background-image: -webkit-linear-gradient(90deg,
rgba(, , , .) %,
transparent %,
transparent %,
rgba(, , , .) %,
rgba(, , , .) %,
transparent %,
transparent)
} /*
* STYLE 11
*/ #style-::-webkit-scrollbar-track
{
-webkit-box-shadow: inset 6px rgba(,,,0.3);
background-color: #F5F5F5;
border-radius: 10px;
} #style-::-webkit-scrollbar
{
width: 10px;
background-color: #F5F5F5;
} #style-::-webkit-scrollbar-thumb
{
background-color: #3366FF;
border-radius: 10px;
background-image: -webkit-linear-gradient(0deg,
rgba(, , , 0.5) %,
transparent %,
transparent %,
rgba(, , , 0.5) %,
rgba(, , , 0.5) %,
transparent %,
transparent)
} /*
* STYLE 12
*/ #style-::-webkit-scrollbar-track
{
-webkit-box-shadow: inset 6px rgba(,,,0.9);
border-radius: 10px;
background-color: #;
} #style-::-webkit-scrollbar
{
width: 12px;
background-color: #F5F5F5;
} #style-::-webkit-scrollbar-thumb
{
border-radius: 10px;
background-color: #D62929;
background-image: -webkit-linear-gradient(90deg,
transparent,
rgba(, , , 0.4) %,
transparent,
transparent)
} /*
* STYLE 13
*/ #style-::-webkit-scrollbar-track
{
-webkit-box-shadow: inset 6px rgba(,,,0.9);
border-radius: 10px;
background-color: #CCCCCC;
} #style-::-webkit-scrollbar
{
width: 12px;
background-color: #F5F5F5;
} #style-::-webkit-scrollbar-thumb
{
border-radius: 10px;
background-color: #D62929;
background-image: -webkit-linear-gradient(90deg,
transparent,
rgba(, , , 0.4) %,
transparent,
transparent)
} /*
* STYLE 14
*/ #style-::-webkit-scrollbar-track
{
-webkit-box-shadow: inset 6px rgba(,,,0.6);
background-color: #CCCCCC;
} #style-::-webkit-scrollbar
{
width: 10px;
background-color: #F5F5F5;
} #style-::-webkit-scrollbar-thumb
{
background-color: #FFF;
background-image: -webkit-linear-gradient(90deg,
rgba(, , , ) %,
rgba(, , , ) %,
transparent %,
rgba(, , , ) %,
transparent)
} /*
* STYLE 15
*/ #style-::-webkit-scrollbar-track
{
-webkit-box-shadow: inset 6px rgba(,,,0.1);
background-color: #F5F5F5;
border-radius: 10px;
} #style-::-webkit-scrollbar
{
width: 10px;
background-color: #F5F5F5;
} #style-::-webkit-scrollbar-thumb
{
border-radius: 10px;
background-color: #FFF;
background-image: -webkit-gradient(linear,
% %,
% %,
from(#4D9C41),
to(#19911D),
color-stop(.,#54DE5D));
} /*
* STYLE 16
*/ #style-::-webkit-scrollbar-track
{
-webkit-box-shadow: inset 6px rgba(,,,0.1);
background-color: #F5F5F5;
border-radius: 10px;
} #style-::-webkit-scrollbar
{
width: 10px;
background-color: #F5F5F5;
} #style-::-webkit-scrollbar-thumb
{
border-radius: 10px;
background-color: #FFF;
background-image: -webkit-linear-gradient(top,
#e4f5fc %,
#bfe8f9 %,
#9fd8ef %,
#2ab0ed %);
} /*
* body
*/
body::-webkit-scrollbar-track
{
-webkit-box-shadow: inset 6px rgba(,,,0.1);
background-color: #F5F5F5;
border-radius: 10px;
} body::-webkit-scrollbar
{
width: 10px;
background-color: #F5F5F5;
} body::-webkit-scrollbar-thumb
{
border-radius: 10px;
background-color: #FFF;
background-image: -webkit-gradient(linear,% %,% %,from(#4D9C41),to(#19911D),color-stop(.,#54DE5D));
} </style>
</head>
<body>
<div id="wrapper">
<div class="scrollbar" id="style-default">
<div class="force-overflow"></div>
</div> <div class="scrollbar" id="style-1">
<div class="force-overflow"></div>
</div> <div class="scrollbar" id="style-2">
<div class="force-overflow"></div>
</div> <div class="scrollbar" id="style-3">
<div class="force-overflow"></div>
</div> <div class="scrollbar" id="style-4">
<div class="force-overflow"></div>
</div> <div class="scrollbar" id="style-5">
<div class="force-overflow"></div>
</div> <div class="scrollbar" id="style-6">
<div class="force-overflow"></div>
</div> <div class="scrollbar" id="style-7">
<div class="force-overflow"></div>
</div> <div class="scrollbar" id="style-8">
<div class="force-overflow"></div>
</div> <div class="scrollbar" id="style-9">
<div class="force-overflow"></div>
</div> <div class="scrollbar" id="style-10">
<div class="force-overflow"></div>
</div> <div class="scrollbar" id="style-11">
<div class="force-overflow"></div>
</div> <div class="scrollbar" id="style-13">
<div class="force-overflow"></div>
</div> <div class="scrollbar" id="style-14">
<div class="force-overflow"></div>
</div> <div class="scrollbar" id="style-15">
<div class="force-overflow"></div>
</div>
</div>
</body>
</html>
自定义滚动条样式纯(css)的更多相关文章
- CSS自定义滚动条样式
原文地址:http://www.qianduan.net/css-custom-scroll-bar-style/ 相信很多人都遇到过在设计中自定义滚动条样式的情景,之前我都是努力说服设计师接受浏览器 ...
- css中渐变的分割线和自定义滚动条样式
css中渐变的分隔线: <div style="background:linear-gradient(to left,#efefef,#b6b6b6,#efefef);height:1 ...
- jQuery自定义滚动条样式插件mCustomScrollbar
如果你构建一个很有特色和创意的网页,那么肯定希望定义网页中的滚动条样式,这方面的 jQuery 插件比较不错的,有两个:jScrollPane 和 mCustomScrollbar. 关于 jScro ...
- 自定义滚动条样式-transition无效
问题 需求是自定义滚动条样式,然后2秒内无操作隐藏滚动条. 2s内隐藏比较麻烦,不能用css实现,只能监听容器的touch事件,然后给滚动条加个opacity: 0的class. .class::-w ...
- WPF 自定义滚动条样式
先看一下效果: 先分析一下滚动条有哪儿几部分组成: 滚动条总共有五部分组成: 两端的箭头按钮,实际类型为RepeatButton Thumb 两端的空白,实际也是RepeatButton 最后就是Th ...
- CSS3自定义滚动条样式
原文地址:→传送门 写在前面 滚动条是个很常见的东东,不过某些浏览器自带的滚动条确实不太好看啊,下面可以作为学习,探讨下自定义滚动条的实现,这样你的滚动条就可以美美的啦.但是,也只能玩玩,因为只针对w ...
- 使用css实现无滚动条滚动+使用插件自定义滚动条样式
使用css实现无滚动条滚动,摘抄自:曹小萌博客 使用css实现无滚动条滚动,大体思路是在div外面再套一个div.这个div设置overflow:hidden.而内容div设置 overflow-x: ...
- CSS3自定义滚动条样式 -webkit-scrollbar(转)
有没有觉得浏览器自带的原始滚动条很不美观,同时也有看到很多网站的自定义滚动条显得高端,就连chrome32.0开发板都抛弃了原始的滚动条,美观多了.那webkit浏览器是如何自定义滚动条的呢? 前言 ...
- CSS3自定义滚动条样式 之 -webkit-scrollbar
有没有觉得浏览器自带的原始滚动条很不美观,同时也有看到很多网站的自定义滚动条显得高端,就连chrome32.0开发板都抛弃了原始的滚动条,美观多了.那webkit浏览器是如何自定义滚动条的呢? 前言 ...
随机推荐
- 【Luogu P3994】高速公路
Problem Background \(C\) 国拥有一张四通八达的高速公路网树,其中有 \(n\) 个城市,城市之间由一共 \(n-1\) 条高速公路连接.除了首都 \(1\) 号城市,每个城市都 ...
- c++ LeetCode (网易面试题和链表以及树篇) 五道算法例题代码详解(三)
原文作者:aircraft 原文链接:https://www.cnblogs.com/DOMLX/p/11209807.html 一.1道网易c++的面试题 我当时第一时间的解答方案 #include ...
- Spring Boot + Redis实战-利用自定义注解+分布式锁实现接口幂等性
场景 不管是传统行业还是互联网行业,我们都需要保证大部分操作是幂等性的,简单点说,就是无论用户点击多少次,操作多少遍,产生的结果都是一样的,是唯一的.而今次公司的项目里,又被我遇到了这么一个幂等性的问 ...
- 手把手教你避开组件cover-view的那些坑
腾讯位置服务基于微信提供的小程序插件能力,专注于(围绕)地图功能,打造一系列小程序插件,可以帮助开发者简单.快速的构建小程序,是您实现地图功能的最佳伙伴.目前微信小程序插件提供路线规划.地铁图.地图选 ...
- Python对Redis增删改查
pip install redis import redis # 连接redis # 几个常用默认参数: # host='localhost', port=6379, db=0, decode_res ...
- 打包Python文件为exe
pip install pyinstaller 然后就在终端里执行命令 cd 到目标文件的目录下 执行 pyinstaller -F ***.py 即可生成exe
- Linux别名工具alias的使用
偶然发现Linux支持自定义命令 现在Linux环境上经常有多个python环境,但是python2马上要停止维护了,所以我想多使用python3,但是Linux上的python命令调用的是pytho ...
- Python进阶小结
目录 一.异常TODO 二.深浅拷贝 2.1 拷贝 2.2 浅拷贝 2.3 深拷贝 三.数据类型内置方法 3.1 数字类型内置方法 3.1.1 整型 3.1.2 浮点型 3.2 字符串类型内置方法 3 ...
- json解析模块
json.loads(json) 把json格式的字符串转为Python数据类型 html_json = json.loads(res.text) json.dumps(python) 把 pytho ...
- 如何将Azure SQL 数据库还原到本地数据库实例中
原文:https://www.jerriepelser.com/blog/restore-sql-database-localdb/ 原文作者: Jerrie Pelser 译文:如何将Azure S ...