Radio button style

HTML
<main> <div class="radio-wrapper"> <input class="radio-button" type="radio" name="sex" id="sex-male" value="male" checked> <label for="sex-male">M</label> <input class="radio-button" type="radio" name="sex" id="sex-female" value="female"> <label for="sex-female">F</label> </div> </main>
CSS
.radio-button{ display: none; } .radio-button+label{ color: #EFEFEF; padding: 1em 0; text-align: center; display: inline-block; float: left; width: 3em; height: 1em; background-color: #9D9D9D; box-shadow: inset 0 0 1em 0.1em #797979; } .radio-button:checked + label{ background-color: #0061AE; /*box-shadow: 0 0 0 0.1em #797979;*/ box-shadow: none; } .radio-wrapper label:first-of-type{ border-radius: 0.5em 0 0 0.5em; } .radio-wrapper label:last-of-type{ border-radius: 0 0.5em 0.5em 0; } /*this style doesn't matter*/ main{ width: 400px; height: 600px; margin: 100px auto; }
JAVASCRIPT
Expand for more options Login