Hint 1, always include enough code to replicate your problem. Once finding the fiddle it was easily fixed.
Point 1 : Use the label tag and use it corectly. You are using a span
where you should be using label
. To associate label
with a form element use the for
attribute with an Id from the form element. It is the label
that gives the user something to click on here.
Point 2: Ordering is important with CSS selectors. If your selector is input + label
the label tag must come after the input
Point 3: Learn the realtionship with position:releative and position:absolute
Finaly, the solution:
.wpcf7-form-control-wrap.RVCategory {
max-width: 400px;
margin: 94px auto 0 auto;
}
.wpcf7-list-item label {
position: relative;
}
.wpcf7-list-item-label,
.wpcf7-list-item last {
font-size: 20px;
}
.wpcf7-form-control-wrap.RVCategory input[type="radio"] {
position: absolute;
opacity: 0;
-moz-opacity: 0;
-webkit-opacity: 0;
-o-opacity: 0;
}
.wpcf7-form-control-wrap.RVCategory input[type="radio"]+label:before {
content: "";
/*Note inline-block*/
display: inline-block;
top: 2px;
height: 14px;
width: 14px;
background: white;
border: 1px solid gray;
box-shadow: inset 0px 0px 0px 2px white;
-webkit-box-shadow: inset 0px 0px 0px 2px white;
-moz-box-shadow: inset 0px 0px 0px 2px white;
-o-box-shadow: inset 0px 0px 0px 2px white;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
-o-border-radius: 8px;
}
.wpcf7-form-control-wrap.RVCategory input[type="radio"]:checked+label:before {
background: #ef8700;
}
<span class="wpcf7-form-control-wrap RVCategory">
<span class="wpcf7-form-control wpcf7-radio">
<span class="wpcf7-list-item first">
<!-- Note the order had changed
and the addition of an id
-->
<input type="radio" name="RVCategory" value="Motorhome" checked="checked" id="rdoMotorHome">
<!--Note the "for" attribute-->
<label class="wpcf7-list-item-label" style="" for="rdoMotorHome">Motorhome</label>
</span>
<span class="wpcf7-list-item last">
<input type="radio" name="RVCategory" value="Trailer" id="rdoTrailer">
<label class="wpcf7-list-item-label" for="rdoTrailer">Trailer</label>
</span>
</span>
</span>