星空网 > 软件开发 > 网页设计

css3的实现的checkbox复选框和radio单选框绚丽美化效果

css3的实现的checkbox复选框和radio单选框绚丽美化效果:
在css3之前要美化单选框和复选框无非是使用图片进行相关的替换操作,并且还有很大的局限性。
由于css3的出现,一切好像变的都变的轻松起来,并且效果非常的绚丽,这是使用css2无法做到的,下面就分享一段能够实现此功能的代码实例,需要的朋友可以做一下参考。
代码如下:

<!DOCTYPE html><html><head><meta charset=" utf-8"><meta name="author" content="http://www.softwhy.com/" /><title>蚂蚁部落</title><head><style type="text/css">@-webkit-keyframes click-wave{ 0%{  width:40px;  height:40px;  opacity:0.35;  position:relative; } 100%{  width:200px;  height:200px;  margin-left:-80px;  margin-top:-80px;  opacity:0.0; }}@-moz-keyframes click-wave{ 0%{  width:40px;  height:40px;  opacity:0.35;  position:relative; } 100%{  width:200px;  height:200px;  margin-left:-80px;  margin-top:-80px;  opacity:0.0; }}@-o-keyframes click-wave{ 0%{  width:40px;  height:40px;  opacity:0.35;  position:relative; } 100%{  width:200px;  height:200px;  margin-left:-80px;  margin-top:-80px;  opacity:0.0; }}@keyframes click-wave{ 0%{  width:40px;  height:40px;  opacity:0.35;  position: relative; } 100%{  width:200px;  height:200px;  margin-left:-80px;  margin-top:-80px;  opacity:0.0; }}.option-input{ -webkit-appearance:none; -moz-appearance:none; -ms-appearance:none; -o-appearance:none; appearance:none; position:relative; top:13.33333px; width:40px; height:40px; -webkit-transition:all 0.15s ease-out 0; -moz-transition:all 0.15s ease-out 0; transition:all 0.15s ease-out 0; background:#cbd1d8; border:none; color:#fff; cursor:pointer; display:inline-block; outline:none; position:relative; margin-right:0.5rem; z-index:1000;}.option-input:hover{ background:#9faab7;}.option-input:checked{ background:#40e0d0;}.option-input:checked::before{ width:40px; height:40px; position:absolute; content:'\2716'; display:inline-block; font-size:26.66667px; text-align:center; line-height:40px;}.option-input:checked::after{ -webkit-animation:click-wave 0.65s; -moz-animation:click-wave 0.65s; animation:click-wave 0.65s; background:#40e0d0; content:''; display:block; position:relative; z-index:100;}.option-input.radio{ border-radius:50%;}.option-input.radio::after{ border-radius:50%;}body{ display:-webkit-box; display:-moz-box; display:box; -webkit-box-orient:horizontal; -moz-box-orient:horizontal; box-orient:horizontal; -webkit-box-pack:start; -moz-box-pack:start; box-pack:start; -webkit-box-align:stretch; -moz-box-align:stretch; box-align:stretch; background:#e8ebee; color:#9faab7; font-family:"Helvetica Neue", Helvetica, Arial, sans-serif; text-align:center;}body div{ padding:5rem;}body label{ display:block; line-height:40px;}</style></head><body><div style="width:200px;float:left"> <label><input type="checkbox" class="option-input checkbox" checked="">Checkbox </label> <label><input type="checkbox" class="option-input checkbox">Checkbox</label> <label><input type="checkbox" class="option-input checkbox">Checkbox</label></div><div style="width:200px;float:left"> <label><input type="radio" class="option-input radio" name="example">Radio option</label> <label><input type="radio" class="option-input radio" name="example">Radio option</label> <label><input type="radio" class="option-input radio" name="example">Radio option</label></div></body></html>

上面的代码实现了我们的要求,这里不多介绍,如有问题可以跟帖留言。

原文地址是:http://www.softwhy.com/forum.php?mod=viewthread&tid=15388

更多内容可以参阅:http://www.softwhy.com/divcss/




原标题:css3的实现的checkbox复选框和radio单选框绚丽美化效果

关键词:CSS

CSS
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

fba美国头程运费:https://www.goluckyvip.com/tag/19780.html
fba美国头程运输:https://www.goluckyvip.com/tag/19781.html
fba美国物流:https://www.goluckyvip.com/tag/19782.html
fba美国物流费用:https://www.goluckyvip.com/tag/19783.html
fba美国物流价格:https://www.goluckyvip.com/tag/19784.html
fba美国要多久:https://www.goluckyvip.com/tag/19786.html
深圳有没有比较好玩的景点 深圳有没有比较好玩的景点推荐一下:https://www.vstour.cn/a/366175.html
长治婚庆女司仪和主持人:https://www.vstour.cn/a/366176.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流