<div class="pub_switch_box">
<input type="checkbox" id="pub_switch_a1" class="pub_switch" />
<label for="pub_switch_a1"></label>
<input type="checkbox" id="pub_switch_a2" class="pub_switch" checked />
<label for="pub_switch_a2"></label>
</div>
/*滑动按钮样式 <-- start --> */
.pub_switch_box {
font-size: 0;
display: inline-block;
margin-left: 30%;
} .pub_switch {
display: none;
} .pub_switch + label {
display: inline-block;
position: relative;
width: 56px;
height: 26px;
margin: 5px;
background-color: #fafbfa;
border-radius: 50px;
-webkit-transition: all 0.1s ease-in;
transition: all 0.1s ease-in;
} .pub_switch + label:after {
content:"";
position: absolute;
top: 0;
width: 100%;
height: 100%;
-webkit-transition: box-shadow 0.1s ease-in;
transition: box-shadow 0.1s ease-in;
left: 0;
border-radius: 100px;
box-shadow: inset 0 0 0 0 #eee, 0 0 1px rgba(0, 0, 0, 0.4);
} .pub_switch + label:before {
content: "";
position: absolute;
top: 0;
left: 1px;
z-index: 999999;
width: 26px;
height: 26px;
-webkit-transition: all 0.1s ease-in;
transition: all 0.1s ease-in;
border-radius: 100px;
box-shadow: 0 3px 1px rgba(0, 0, 0, 0.05), 0 0 1px rgba(0, 0, 0, 0.3);
background: white;
} .pub_switch:active + label:after {
box-shadow: inset 0 0 0 20px #eee, 0 0 1px #eee;
}
.pub_switch:active + label:before {
width: 37px;
}
.pub_switch:checked:active + label:before {
width: 37px;
left: 20px;
}
.pub_switch + label:active {
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05),
inset 0 1px 3px rgba(0, 0, 0, 0.1);
}
.pub_switch:checked + label:before {
content: "";
position: absolute;
left: 31px;
border-radius: 100px;
}
.pub_switch:checked + label:after {
content: "";
font-size: 1.5em;
position: absolute;
background: #3399ff;
box-shadow: 0 0 1px #3399ff;
}
/* <-- end --> */

css 滑动按钮样式的更多相关文章

  1. 利用纯CSS美化checkbox和radio和滑动按钮的实现

    W3C提供的CheckBox和radio的原始样式非常的丑,而且在不同的额浏览器表现还不一样,使用常规的方法添加样式没法进行修改样式 一, 单选按钮 <html> <head> ...

  2. 纯CSS打造好看的按钮样式

    好看的按钮.链接.div样式,效果预览: http://hovertree.com/code/run/css/s8o19792.html 发现今天积分和排名不错: 代码如下: <!DOCTYPE ...

  3. 漂亮的CSS按钮样式集以及在线生成工具

    以前我们制作一样带带阴影.圆角或3D感的按钮都需要用图片来制作,但CSS3出来后就可以不用图片了,由于是代码写的按钮样式,在Retina上浏览依然清晰美观.虽然不错,但我们写一个阴影+质感的按钮还是挺 ...

  4. [HTML/CSS]uploadify自定义按钮样式

    概述 在项目中经常用到uploadify上传插件,但是FLASH按钮的外观往往跟我们网页的设计的主题色不太搭配.这时就需要对其样式进行修改. 样式文件是uploadify.css. 打开这个文件后,你 ...

  5. 「HTML+CSS」--自定义按钮样式【002】

    前言 Hello!小伙伴! 首先非常感谢您阅读海轰的文章,倘若文中有错误的地方,欢迎您指出- 哈哈 自我介绍一下 昵称:海轰 标签:程序猿一只|C++选手|学生 简介:因C语言结识编程,随后转入计算机 ...

  6. CSS/CSS3常用样式小结

    1.强制文本单行显示: white-space:nowrap; 多行文本最后省略号: display: -webkit-box; -webkit-line-clamp:2; overflow: hid ...

  7. [总结]CSS/CSS3常用样式与web移动端资源

    CSS/CSS3常用样式与知识点 IE条件注释 条件注释简介 IE中的条件注释(Conditional comments)对IE的版本和IE非IE有优秀的区分能力,是WEB设计中常用的hack方法.条 ...

  8. [原创]Lodop打印, 以及Lodop引用css文件控制打印样式的问题.

    最近在做Lodop打印功能: 思路是:  用MasterPage搭个打印页面的框架, 然后在具体的页面中填入数据, 打印的样式由母版页和CSS来控制. 困扰了一天的问题是:  在打印的JS文件中, 引 ...

  9. 5个基于css3超炫的鼠标滑动按钮动画

    今天给大家分享5个基于css3超炫的鼠标滑动按钮动画.这5个按钮鼠标经过的时候有超炫的动画效果.这5个按钮适用浏览器:360.FireFox.Chrome.Safari.Opera.傲游.搜狗.世界之 ...

随机推荐

  1. 判断i在字符串中出现的次数(2016.1.12P141-1)

    // 方法一,利用substring截取获得出现的次数 String number = "iminigrikejijavabi"; String a = number; int c ...

  2. Nutch相关框架视频教程--说明

    PDF文档: Nutch大数据相关框架讲义.pdf Nutch1.7二次开发培训讲义.pdf Nutch1.7二次开发培训讲义之腾讯微博抓取分析 Nutch公开课从搜索引擎到网络爬虫 ======== ...

  3. C、VDD、VSS、 VEE 和VPP的区别

    http://www.cnblogs.com/crazybingo/archive/2010/05/14/1735802.html C.VDD.VSS. VEE 和VPP的区别 在电子电路中,常可以看 ...

  4. 第四章 跨平台图像显示库——SDL 第一节 与SDL第一次亲密接触

    http://blog.csdn.net/visioncat/article/details/1596576 GCC for Win32 开发环境介绍(5) 第四章 跨平台图像显示库——SDL 第一节 ...

  5. Mongo中的数据类型

    一.null null用于表示空值或者不存在的字段 {"X" : null} 二.布尔型 布尔类型有两个值true和false {"x" : true} 三.数 ...

  6. php---将数组转化为数组对象

    例子:array(1){ [0]=>array( 'id'=>111, 'name'=>'aaaa' ) } 由上面的例子转化成下面对象,怎么转化?急急 急 谢谢array(1) { ...

  7. 20145211 《Java程序设计》实验报告二:Java面向对象程序设计

    实验要求 初步掌握单元测试和TDD 理解并掌握面向对象三要素:封装.继承.多态 初步掌握UML建模 熟悉S.O.L.I.D原则 了解设计模式 实验内容 单元测试 面向对象三要素 设计模式初步 练习 实 ...

  8. .NET:OrderBy和ThenBy

    .NET中OrderBy和ThenBy的语义是不同的,如:list.OrderBy(x=>x.A).OrderBy(x=>x.B),那么最终只会根据B进行排序:list.OrderBy(x ...

  9. Introduction to Project Management(II)

    Introduction The purpose of this paper is to gain an understanding of project management and to give ...

  10. 如何将数据库中的表导成XML文件

    1.现将数据库中的信息读到DataTable中 2.用函数将DataTable转为string private string ConvertDataTableToXML(DataTable dt) { ...