switch开关
1.开关按钮 效果如下图

2.css代码
.form-switch{
display: inline-block;
}
.form-switch input[type="checkbox"]{ display: none; }
.form-switch >div{
position: relative;
display: inline-block;
padding: 0 5px;
width: auto!important;
min-width: 35px;
height: 22px;
line-height: 22px;
background-color: #fff;
box-shadow: #ccc 0px 0px 0px 2px;
border-radius: 20px;
overflow: hidden;
}
.form-switch div>span{
color: #999;
}
.form-switch i{
position: absolute;
left: 5px;
top: 3px;
width: 16px;
height: 16px;
border-radius: 50%;
background-color: #d2d2d2;
-webkit-transition: .1s linear;
transition: .1s linear;
}
.form-switch div >em{
position: relative;
top:;
width: 25px;
margin-left: 21px;
padding: 0!important;
text-align: center!important;
color: #999!important;
font-style: normal!important;
font-size: 12px;
}
.form-switch div >em:last-child{
display: block;
}
.form-switch input[type="checkbox"]:checked + div {
border-color: #3679b7;
background-color: #3679b7;
color: #fff;
}
.form-switch input[type="checkbox"]:checked + div i{
left: 100%;
margin-left: -21px;
background-color: #fff;
}
.form-switch input[type="checkbox"]:checked + div em:last-child{
display: block;
color: #fff;
margin-left: 5px;
margin-right: 21px;
color: #fff!important;
}
.form-switch input[type="checkbox"]:checked + div em:nth-child(2){
display: none;
color: #fff;
}
3.html结构
<label class="form-switch">
<input type="checkbox" id="toggle-button" name="switch" checked="">
<div>
<i></i>
<em>OFF</em>
<em>ON</em>
</div>
</label>
switch开关的更多相关文章
- 自定义switch开关
自定义一个switch开关 <!DOCTYPE html> <html> <head> <meta charset="utf-8"> ...
- mui的switch开关的应用
HTML: <!--mui的switch开关--> <div class="mui-content-padded"> <h5>switch开关m ...
- CSS做一个Switch开关
本文为博主原创,转载请注明出处. Switch开关: 根据需求可知,Switch开关只有两种选择,true或false.所以我们想到HTML的checkbox控件,用它来做. <input id ...
- 使用css3 制作switch开关
使用css3来实现switch开关的效果: html代码: <!--switch开关--><div class="switch-btn"> <inpu ...
- 微信小程序组件解读和分析:十五、switch 开关选择器
switch 开关选择器组件说明: switch,开关选择器.只能选择或者不选.这种属于表单控件或者查询条件控件. switch 开关选择器示例代码运行效果如下: 下面是WXML代码: [XML] 纯 ...
- elementui switch 开关,点击确认按钮后在进行开关
<el-table-column label="上头条" align="center"> <template slot-scope=" ...
- 微信小程序 主题皮肤切换(switch开关)
示例效果: 功能点分析: 1.点击switch开关,切换主题皮肤(包括标题栏.底部tabBar):2.把皮肤设置保存到全局变量,在访问其它页面时也能有效果3.把设置保存到本地,退出应用再进来时,依然加 ...
- mui switch(开关)里面token不能及时更新
做登录的时候再本地用locaStorage存了一个token值,但是登录之后进入页面里面发现一个switch开关里面的token值会跟着开关的切换在上一个token和当前的这个token值之间切换,我 ...
- layui switch 开关监听 弹出确定状态转换
不废话,直接上图: 原始状态: 点击确定: 点击取消或者X 代码: <!doctype html> <html lang="en"> <head& ...
- mui switch 开关js控制打开 & Cannot read property 'toggle' of null
//打开开关 mui('#mySwitch').switch().toggle(); //小开关打开异常的情况解决办法$(".mui-switch-handle").attr(&q ...
随机推荐
- Ubuntu16.04安装PostgreSQL并使用pgadmin3管理数据库_图文详解
版权声明:本文地址http://blog.csdn.net/caib1109/article/details/51582663 欢迎非商业目的的转载, 作者保留一切权利 apt安装postgresql ...
- (KMP)Count the string -- hdu -- 3336
http://acm.hdu.edu.cn/showproblem.php?pid=3336 Count the string Time Limit: 2000/1000 MS (Java/Other ...
- ActiveMq 配置多队列
一直在赶项目,好久没有写博文了,中间偶尔有些代码什么的,也都是放到github了,不过大多都是测试代码,毕竟有些成型的东西是给公司写的,鉴于职业道德,还是不好公开. 言归正传,这两天在接入第三方的收费 ...
- Linux C++ - IP地址转换函数
1. 函数用途:数字网络序本地序转换 适用类型:IP地址uint32_t类型.端口号uint16_t类型 #include<netinet/in.h> extern uint32_t nt ...
- SQL Server 紧急状态下的数据库恢复
背景:由于服务器硬盘损坏,服务器异常关机.重新进入后,数据库为质疑状态.(数据库名字上面有个感叹号,连接不了) 经过无数次的百度以及大佬们的指点下,终于成功恢复,下面来说一下方法. 第一种: 1.在服 ...
- STM32F4时钟配置库函数详解
在STM32中,所有的应用都是基于时钟,所以时钟的配置就尤为重要了,而不能仅仅只知道使用默认时钟. STM32F4的时钟树如上图所示,HSE为外部接入的一个8M的时钟,然后再给PLL提供输入时钟,经过 ...
- [翻译].NET Core 3 Preview1和Windows桌面框架开源
原文来自TechViews 今天,我们宣布推出.NET Core 3 Preview 1.这是.NET Core 3的第一个公开发布.我们有一些令人兴奋的新功能可供分享,并希望得到您的反馈.您可以使用 ...
- 我所理解的网络游戏<一>:网游的顶层设计
网游的基本结构 各大模块的基本功能如下 · 服务器端 登陆服:处理新建玩家.登陆逻辑. 场景服:处理场景服中的逻辑. 中心服:处理跨服的逻辑,实现不同场景服进程的数据调度,以及向数据库查询数据. 数据 ...
- 第二章 ConcurrentHashMap源码解析
注:在看这篇文章之前,如果对HashMap的层不清楚的话,建议先去看看HashMap源码解析. http://www.cnblogs.com/java-zhao/p/5106189.html 1.对于 ...
- BroadcastReceive的使用
一.注册方式 intent.setAction("BC_One"); 1.静态注册 <receiver android:name = "继承BroadcastRe ...