I'm in need of a custom checkbox with content inside that allows for multiple selections, similar to the example below:
https://i.sstatic.net/CbNXv.png
<div class="row">
<div class="form-group">
<input type="checkbox" id="html">
<label for="html"></label>
</div>
<div class="form-group">
<input type="checkbox" id="css">
<label for="css"></label>
</div>
<div class="form-group">
<input type="checkbox" id="javascript">
<label for="javascript"></label>
</div>
</div>
CSS
.form-group {
display: block;
margin-bottom: 15px;
}
.form-group input {
padding: 0;
height: initial;
width: initial;
margin-bottom: 0;
display: none;
cursor: pointer;
}
.form-group label {
position: relative;
cursor: pointer;
}
.form-group label:before {
content:'';
-webkit-appearance: none;
background-color: orange;
border: 2px solid tranparent;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), inset 0px -15px 10px -12px rgba(0, 0, 0, 0.05);
padding: 15px;
display: inline-block;
position: relative;
vertical-align: middle;
cursor: pointer;
margin-right: 5px;
border-radius: 30px;
}
.form-group input:checked + label:after {
content: '';
display: block;
position: absolute;
top: 2px;
left: 12px;
width: 6px;
height: 14px;
border: solid #0079bf;
border-width: 0 2px 2px 0;
transform: rotate(45deg);
}
The user has the ability to select and deselect values (selected ones are in dark orange while unselected are light orange). I have tried implementing these checkboxes, but only get an OK sign content. Can anyone suggest how I could achieve this?
Any assistance would be greatly appreciated.
Thanks in advance!