I've styled a checkbox like a button however when the checkbox is checked it doesn't apply the style that I have wrote for the button.
Just wondering what I am doing wrong hopefully it's not too obvious.
Html
<div class="customCheckBox"style="margin-top:10px; margin: 10px auto;">
<input class="checkbox" type="checkbox" name="check1" id="check1">
<label class="checklabel" for="check1">Directors, Managers & Professionals</label>
</div>
CSS
body {
font-family: 'Source Sans Pro', Arial, sans-serif;
font-size: 14px;
line-height: 1.429;
margin: 0;
padding: 0;
color: #000000;
}
.customCheckBox{
height: 60px;
display:flex;
width:190px;
color: #702082;
font-weight: 600;
border:3px solid #702082;
position: relative;
align-items: center;
transition: all 0.2s;
}
.customCheckBox:hover{
background-color: #702082;
color: white;
-moz-box-shadow: 3px 3px 10px rgba(0, 0, 0,0.25);
-webkit-box-shadow: 3px 3px 10px rgba(0, 0, 0, .25);
box-shadow: 3px 3px 10px rgba(0, 0, 0, .25);
}
.checklabel {
text-align:center;
font-size:1.1em;
}
.checkbox {
position:absolute;
right:-3px;
top:-3px;
width: 190px;
height: 60px;
-webkit-appearance: none;
-moz-appearance: none;
-ms-appearance: none;
appearance: none;
border:none;
padding:0;
border-radius:0;
transition:.3s ease;
outline:0;
}
.checkbox:checked + .customCheckBox {
background-color: #702082;
color: white;
}
Here Is a Jfiddle of it too http://jsfiddle.net/pjtmzLy5/1/.