首页 > 其他 > 详细

自定义复选框checkbox

时间:2015-12-23 16:12:30      阅读:250      评论:0      收藏:0      [点我收藏+]

//html

<div class="checkboxFive">
<input type="checkbox" value="1" id="checkboxFiveInput" name="" />
<label for="checkboxFiveInput"></label>
</div>
<div class="checkboxCont">已阅读并同意服务协议!</div>

 

//css样式

.checkboxFive { width: 18px; position: relative;}
.checkboxFive label { cursor: pointer; position: absolute; width: 18px; height: 18px; top: -1px; left: -1px; background: #0d97d7; border:1px solid #fff; border-radius: 5px;}
.checkboxFive label:after { opacity: 0.1; content: ‘‘; position: absolute; width: 9px; height: 5px; background: transparent; top: 3px; left: 4px; border: 2px solid #fff; border-top: none; border-right: none; -webkit-transform: rotate(-45deg); -moz-transform: rotate(-45deg); -o-transform: rotate(-45deg); -ms-transform: rotate(-45deg); transform: rotate(-45deg);}
.checkboxFive label:hover::after { opacity: 0.1;}
.checkboxFive input[type=checkbox]:checked + label:after { opacity: 1;}
.checkboxCont{ line-height: 18px; padding-left: .5rem;}

自定义复选框checkbox

原文:http://www.cnblogs.com/allenfei/p/5069983.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!