css怎么做打勾的方框

html-css08

css怎么做打勾的方框,第1张

这个得用Html做的

<form action="" method="get">

您喜欢的水果?<br />

<label><input name="Fruit" type="checkbox" value="0" />苹果 </label>

<label><input name="Fruit" type="checkbox" value="1" />桃子 </label>

<label><input name="Fruit" type="checkbox" value="2" />香蕉 </label>

<label><input name="Fruit" type="checkbox" value="3" />梨 </label>

</form>

给你个插件吧:http://www.bootcss.com/p/icheck/

原理就是自己做两个checkbox的样式,一个为空一个为选中状态。将原来的默认的checkbox隐藏掉,通过label去控制隐藏掉的checkbox状态。最后通过js判断该隐藏的checkbox状态,从而改变你自定义的checkbox样式。

希望可以帮到你。