I added a custom radio button, but it's not showing up. It seems to work when arranged like this:
<label>
<input type="radio" name="gender" />
<span>Female</span>
</label>
Why isn't it working? Is there something wrong with this code?
This is my HTML Code:
<div class="radio_btns">
<label><span>Gender</span></label>
<label>
<span>Female</span>
<input type="radio" name="gender" />
</label>
<label>
<span>Male</span>
<input type="radio" name="gender" />
</label>
</div>
This is the CSS Code:
.radio_btns {width:100%; float:left;}
.radio_btns [type="radio"] {border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px;}
.radio_btns label {display: block; cursor: pointer; line-height: 2.5;}
.radio_btns [type="radio"] + span {display: block;}
.radio_btns [type="radio"] + span:before {content: ''; display: inline-block; width: 1em; height: 1em; vertical-align: -0.25em; border-radius: 1em; border: 0.125em solid #fff; box-shadow: 0 0 0 0.15em #000; margin-right: 0.75em; transition: 0.5s ease all;}
.radio_btns [type="radio"]:checked + span:before {background: #07eb07; box-shadow: 0 0 0 0.25em #000;}
.radio_btns label {float:left; width:150px;}