<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. PHP 随机显示

    <?php  print_r(    array_rand(      array(        "新春快乐"=>"",        " ...

  2. 【IOS笔记】Using View Controllers in Your App

    参考:http://www.cnblogs.com/patientAndPersist/p/3279645.html Using View Controllers in Your App Whethe ...

  3. notepad++ gvim editplus 三款选择试用

    notepad++开源  试用还不错  但默认不会识别语法高亮  要自己设置  比较烦 gvim 在XP下竟然无法返回命令行  百般折腾无奈放弃 editplus 自带资源栏  选择器  文件查找功能 ...

  4. Linux常用命令-入门

    linux 开源安全性高 linux 和 windows 1.同时登陆多用户 2.安全 3.linux没有盘符的概念 /. /        root      根目录 4.linux的文件没有扩展名 ...

  5. 初步理解Java的三大特性——封装、继承和多态

    声明:整理自网络,如有雷同,请联系博主处理 一.封装 封装从字面上来理解就是包装的意思,专业点就是信息隐藏,是指利用抽象数据类型将数据和基于数据的操作封装在一起,使其构成一个不可分割的独立实体,数据被 ...

  6. ubuntu下各个软件完全卸载

    1.卸载mysql sudo rm /var/lib/mysql/ -R删除mysql的数据文件2sudo rm /etc/mysql/ -R删除mqsql的配置文件3sudo apt-get aut ...

  7. hibernate manytoone中的lazy EAGER

    Hibernate中的字段映射中的Fetch有两种方式:EAGER和LAZY Eager:全部抓取 Lazy:延迟抓取 如果在字段中声明为Eager,那么在取得当前Bean时,同时会抓取Bean中的关 ...

  8. python 之 utf-8编码的秘密

    python3的默认编码方案是utf-8编码,看了些资料,来做总结. 要说utf-8,就要说说unicode,要说unicode,就要说ASCII,我们还是慢慢来. 1.ASCII ASCII编码最初 ...

  9. SimpleUrlHandlerMapping 使用

    <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.sp ...

  10. 《Haskell趣学指南 Learn You a Haskell for Great Good!》-代码实验

    doubleMe x = x + x doubleUs x y = doubleMe x + doubleMe y doubleSmallNumber x = then x else x * doub ...