我在contact-form-7中设置了3个复选框 这是联系代码
<div class="form-group checkbox">
[checkbox participated_2016 default:1 "I Participated at Mercy Ships Cargo Day 2016"]
</div>
<div class="form-group checkbox">
[checkbox want_to_participate default:1 "I Want to participate to Mercy Ships Cargo Day 2017"]
</div>
<div class="form-group checkbox">
[checkbox join_mailing default:1 "Join Cargo Day mailing list"]
</div>
我把这个css推到了它的样式
.checkbox .wpcf7-list-item span {
display: inline-block;
position: relative;
padding-left: 15px;
}
.checkbox .wpcf7-list-item span::before {
content: "";
display: inline-block;
position: absolute;
width: 17px;
height: 17px;
left: 0;
margin-left: -20px;
border: 1px solid #cccccc;
border-radius: 3px;
background-color: #fff;
-webkit-transition: border 0.15s ease-in-out, color 0.15s ease-in-out;
-o-transition: border 0.15s ease-in-out, color 0.15s ease-in-out;
transition: border 0.15s ease-in-out, color 0.15s ease-in-out;
}
.checkbox .wpcf7-list-item span::after {
display: inline-block;
position: absolute;
width: 16px;
height: 16px;
left: 0;
top: 0;
margin-left: -20px;
padding-left: 3px;
padding-top: 1px;
font-size: 11px;
color: #0cf !important;
}
.checkbox .wpcf7-list-item input[type="checkbox"] {
opacity: 0;
}
.checkbox .wpcf7-list-item input[type="checkbox"]:focus + span::before {
outline: thin dotted;
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px;
}
.checkbox .wpcf7-list-item input[type="checkbox"]:checked + span::after {
font-family: 'FontAwesome';
content: "\f00c";
color: #0cf;
}
.checkbox .wpcf7-list-item input[type="checkbox"]:disabled + span {
opacity: 0.65;
}
.checkbox .wpcf7-list-item input[type="checkbox"]:disabled + span::before {
background-color: #eeeeee;
cursor: not-allowed;
}
.checkbox.checkbox-circle span::before {
border-radius: 50%;
}
.checkbox.checkbox-inline {
margin-top: 0;
}
.checkbox-primary input[type="checkbox"]:checked + span::before {
background-color: #428bca;
border-color: #428bca;
}
.checkbox-primary input[type="checkbox"]:checked + span::after {
color: #fff;
}
.checkbox .wpcf7-list-item input:focus, .checkbox input:active:focus, .checkbox input.active:focus {
outline: none;
box-shadow: none;
}
但是当我按照我点击的方式设置任何复选框时,所有三个都被选中并同时取消选择。 有谁知道为什么?