赞
踩
http://www.jq22.com/webqd5287,由于复选框默认样式为矩形,修改为圆形需要通过伪类实现
html部分
<input name="checkbox" value="Item 1" type="checkbox" class="tui-checkbox ">
<input name="checkbox" value="Item 1" type="checkbox" class="tui-checkbox ">
<input name="checkbox" value="Item 1" type="checkbox" class="tui-checkbox ">
css部分
//设置选中背景 .tui-checkbox:checked { background:#1673ff } //设置复选框样式 .tui-checkbox { width:25px; height:25px; background-color:#ffffff; border:solid 1px #dddddd; -webkit-border-radius:50%; border-radius:50%; font-size:0.8rem; margin:0; padding:0; position:relative; display:inline-block; vertical-align:top; cursor:default; -webkit-appearance:none; -webkit-user-select:none; user-select:none; -webkit-transition:background-color ease 0.1s; transition:background-color ease 0.1s; } //设置伪类,即显现的对勾样式 .tui-checkbox:checked::after { content:''; top:5px; left:5px; position:absolute; background:transparent; border:#fff solid 2px; border-top:none; border-right:none; height:6px; width:10px; -moz-transform:rotate(-45deg); -ms-transform:rotate(-45deg); -webkit-transform:rotate(-45deg); transform:rotate(-45deg); }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。