需求 :用图片代替原始单选按钮
思路:制作的过程 把原来的input选框隐藏,然后给他一个背景图片 当他选中的时候替换背景图片
html代码
<label>
<input type="checkbox" id="check"/>
<div></div>
<span>记住密码</span>
</label>
Css样式
body{background:#ccc;}
label{position:relative;padding-left:65px;}
label input[type='checkbox']{display:inline-block;opacity:0;position:absolute;}
label input[type='checkbox']+div{width:65px;height:66px;background:#fff;top:0;}
label input[type='checkbox']:checked+div{background:url(img/duihao.jpg) no-repeat 100%;}