龙空技术网

纯CSS3仿ios开关按钮代码

寒笛过霜天 41

前言:

此刻看官们对“html重写按钮代码怎么写”可能比较注意,兄弟们都需要知道一些“html重写按钮代码怎么写”的相关知识。那么小编同时在网上搜集了一些关于“html重写按钮代码怎么写””的相关资讯,希望我们能喜欢,咱们快快来了解一下吧!

按钮为橙色

<html><head><meta charset="utf-8"><title>1.2-纯CSS3仿ios开关按钮代码</title><style type="text/css">.switch{}.switch li{clear:both;line-height:45px;border-bottom:1px solid #CCC;list-style:none;}.switch input{ display:none}.switch label{width:50px; background:#999 ;height:28px;border-radius:15px;float:right;margin:8px 10px 0 0;box-shadow: 0 1px 2px rgba(0,0,0,.1) inset;}.switch label em{width:25px;height:26px;float:left;margin:1px;border-radius:14px;background:#FFF ;}.switch input:checked+label{background:#F90;}.switch input:checked+label em{margin:1px 1px 1px 25px;}</style></head><body><ul class="switch"><li><input type="checkbox" name="aaa" id="a1" />流量不足提醒<label for="a1"><em></em></label></li><li><input type="checkbox" name="bbb" id="b1" />余额不足提醒<label for="b1"><em></em></label></li></ul></body></html>

按钮为绿色

<html><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /><meta content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no" name="viewport" /><style type="text/css">.Switch {margin: 0;padding: 0;}.Switch li {clear: both;line-height: 44px;border-bottom: 1px solid #CCC;list-style: none;}.Switch input {display: none}.Switch label {width: 52px;background: #CCC;height: 28px;border-radius: 14px;float: right;margin: 8px 10px 0 0;box-shadow: 0 1px 2px rgba(0,0,0,.1) inset;}.Switch label em {width: 26px;height: 26px;float: left;margin: 1px;border-radius: 13px;box-shadow: 2px 3px 8px rgba(0,0,0,.1);background: #FFF;transition: 0.1s;}.Switch input:checked + label {background: #a4d714;}.Switch input:checked + label em {margin: 1px 1px 1px 25px;}.Switch input:disabled + label {opacity: 0.5}</style><title>开关测试2</title></head><body><ul class="Switch"><li><input type="checkbox" name="Storage" id="date" />流量不足提醒<label for="date"><em></em></label></li><li><input type="checkbox" name="Storage2" id="blance" checked />余额不足提醒<label for="blance"><em></em></label></li><li><input type="checkbox" name="Storage2" id="integral" disabled />积分兑换提醒<label for="integral"><em></em></label></li></ul></body></html>

标签: #html重写按钮代码怎么写