啥都不说先看图:

注: 只适合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)的更多相关文章

  1. CSS自定义滚动条样式

    原文地址:http://www.qianduan.net/css-custom-scroll-bar-style/ 相信很多人都遇到过在设计中自定义滚动条样式的情景,之前我都是努力说服设计师接受浏览器 ...

  2. css中渐变的分割线和自定义滚动条样式

    css中渐变的分隔线: <div style="background:linear-gradient(to left,#efefef,#b6b6b6,#efefef);height:1 ...

  3. jQuery自定义滚动条样式插件mCustomScrollbar

    如果你构建一个很有特色和创意的网页,那么肯定希望定义网页中的滚动条样式,这方面的 jQuery 插件比较不错的,有两个:jScrollPane 和 mCustomScrollbar. 关于 jScro ...

  4. 自定义滚动条样式-transition无效

    问题 需求是自定义滚动条样式,然后2秒内无操作隐藏滚动条. 2s内隐藏比较麻烦,不能用css实现,只能监听容器的touch事件,然后给滚动条加个opacity: 0的class. .class::-w ...

  5. WPF 自定义滚动条样式

    先看一下效果: 先分析一下滚动条有哪儿几部分组成: 滚动条总共有五部分组成: 两端的箭头按钮,实际类型为RepeatButton Thumb 两端的空白,实际也是RepeatButton 最后就是Th ...

  6. CSS3自定义滚动条样式

    原文地址:→传送门 写在前面 滚动条是个很常见的东东,不过某些浏览器自带的滚动条确实不太好看啊,下面可以作为学习,探讨下自定义滚动条的实现,这样你的滚动条就可以美美的啦.但是,也只能玩玩,因为只针对w ...

  7. 使用css实现无滚动条滚动+使用插件自定义滚动条样式

    使用css实现无滚动条滚动,摘抄自:曹小萌博客 使用css实现无滚动条滚动,大体思路是在div外面再套一个div.这个div设置overflow:hidden.而内容div设置 overflow-x: ...

  8. CSS3自定义滚动条样式 -webkit-scrollbar(转)

    有没有觉得浏览器自带的原始滚动条很不美观,同时也有看到很多网站的自定义滚动条显得高端,就连chrome32.0开发板都抛弃了原始的滚动条,美观多了.那webkit浏览器是如何自定义滚动条的呢? 前言 ...

  9. CSS3自定义滚动条样式 之 -webkit-scrollbar

    有没有觉得浏览器自带的原始滚动条很不美观,同时也有看到很多网站的自定义滚动条显得高端,就连chrome32.0开发板都抛弃了原始的滚动条,美观多了.那webkit浏览器是如何自定义滚动条的呢? 前言 ...

随机推荐

  1. Java题库——Chapter3 操作符、选择

    1)The "less than or equal to" comparison operator in Java is ________. A)<< B) != C) ...

  2. 简单实用的原生PHP分页类

    一款简单实用的原生PHP分页类,分页按钮样式简洁美观,页码多的时候显示“...”,也是挺多网站用的效果 核心分页代码 include_once("config.php"); req ...

  3. Oracle数据库之第二篇

    /* 多表查询 多个数据库表做连接查询 使用场景: 查询的数据来源为多个表 */ --查询员工信息和员工的部门信息 select * from emp; select * from dept; --使 ...

  4. centOS极简安装并启动ngnix

    我在网上看到过很多种方法在centOS中安装nginx,比如像这样的: 这种方式太麻烦了,看了很恶心. 我在官网看到有这样一种操作,可谓极简.特此记录一下:(官网教程地址:http://nginx.o ...

  5. SpringCloud(九):springcloud——链路追踪springcloud-sleuth

    Spring-Cloud-Sleuth是Spring Cloud的组成部分之一,为SpringCloud应用实现了一种分布式追踪解决方案,其兼容了Zipkin, HTrace和log-based追踪, ...

  6. Vue组件通信的几种方法

    上一节说到,vue.js是允许子组件通过props接受父组件的信息,但是不允许父组件通过props接受子组件的信息 1. $emit()和on 当子组件需要向父组件传递数据时,就要用到自定义事件. 使 ...

  7. 手把手教你避开组件cover-view的那些坑

    腾讯位置服务基于微信提供的小程序插件能力,专注于(围绕)地图功能,打造一系列小程序插件,可以帮助开发者简单.快速的构建小程序,是您实现地图功能的最佳伙伴.目前微信小程序插件提供路线规划.地铁图.地图选 ...

  8. PHP匿名函数、闭包、function use

    匿名函数,也叫闭包函数(closures) ,允许临时创建一个没有制定名称的函数.最常用作回调函数(callback)参数的值. 闭包函数也可以作为变量的值来使用.PHP将会自动把此种表达式转换成内置 ...

  9. pymysql增删改查操作

    表结构 CREATE TABLE `students` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(20) DEFA ...

  10. Django—使用后台管理Models

    后台的配置 1.创建后台管理员 [root@localhost study_django]# python manage.py createsuperuser [root@localhost stud ...