自定义滚动条样式纯(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浏览器是如何自定义滚动条的呢? 前言 ...
随机推荐
- Selenium(六):frame切换、窗口切换
1. 切换到frame index.html: <!DOCTYPE html> <html> <head> <meta charset="UTF-8 ...
- java基础(2):注释、关键字、标识符、数据
1. 注释.关键字与标识符 大家可以安装一个文本编辑软件notepad++,有利于java代码的查看与编写. 1.1 程序注释 通常我们需要在源代码中添加文字用来对进行代码解释说明,但这些文字并不是J ...
- Comprehensive Tutorial 综合教程(MainDemo应用程序)
Follow this tutorial to create a simple application used to store contacts and other related objects ...
- P1005 Spell It Right
# P1005 Spell It Right 原题 Given a non-negative integer N, your task is to compute the sum of all the ...
- Shell—各种括号的用法
括号的种类 小括号,圆括号 ( ) 中括号,方括号 [ ] 大括号.花括号 { } 一.单小括号 () 1.另开命令组——小括号中的命令将会新开启一个子shell独立顺序运行,所以括号中的变量不能够被 ...
- githup常用备份
https://github.com/ https://github.com/doumeki/ThrExcel https://github.com/xinxi1990/MyMonkey https: ...
- 公司员工表示 nginx 之父被警方带走
ZDNet 12 日报导,俄罗斯警方当天突击搜查了 NGINX 公司(nginx 服务器项目商业化公司)在莫斯科的办事处,并带走了 NGINX 公司联合创始人 Igor Sysoev 与 Maxim ...
- express搭建后端请求路由,前端进行访问对应的接口 后端解决跨域
代码在 ==>E:\nodes实战\myserve\testserve 1 express搭建后端请求路由,前端进行访问对应的接口 1) 创建项目目录 express 项目名 -e 然后按照提示 ...
- TeamyinyinFish-凡事遇则立
小组github地址: https://github.com/TeamyinyinFish 1.项目的总结反思 阿尔法迭代的时候我们只是理想的随意的选择了一个项目并且认为非常简单. 在第二轮迭代的时候 ...
- 解决 eclipse出现 Address already in use: bind,以及tomcat端口占用
在项目开发中,有时候我们发现回报这个错:解决 eclipse出现 Address already in use: bind 产生的原因是端口占用,比如你的8080端口,已经有一个进程在访问使用,但是你 ...