调试方法:
1 在页面中打开开发者工具(本例以chrome浏览器为例),
2.选则选中的checkbox货radio.
3.在右侧的style面板中点击new Style rule 输入
input[type="checkbox"]:checked {
margin: 30px
}
即可以看到效果。
4.勾掉选中状态则margin的效果消失。
checked 属性规定在页面加载时应该被预先选定的 input 元素。checked 属性 与 <input type="checkbox">或 <input type="radio">配合使用。
并不是checked="true"
具体用法如下
<input type="radio" checked />
或
<input type="radio" checked="checked" />