Created
September 23, 2019 10:54
-
-
Save waqashassan98/72c7d2527d56cf3a172d006d7161e845 to your computer and use it in GitHub Desktop.
checkbox styling with custom image. Works with labels
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.class_checkbox { | |
display:none; | |
} | |
.class_checkbox + label:before{ | |
background:url('/img/checkbox.png') no-repeat; | |
width: 42px!important; | |
height: 43px!important; | |
display:inline-block; | |
margin-right: 10px!important; | |
background-size: contain; | |
background-repeat: no-repeat; | |
vertical-align: middle; | |
content: ""; | |
} | |
.class_checkbox:checked + label:before{ | |
background-image: url(/img/checkbox-selected.png); | |
background-size: contain!important; | |
height: 60px!important; | |
background-repeat: no-repeat; | |
display:inline-block; | |
padding: 0 0 0 0px; | |
vertical-align: middle; | |
content: ""; | |
} | |
<div class="input_class_checkbox" > | |
<ul> | |
<li><input type="checkbox" id="test-316-field_5_1" name="test[]" value="Measuring Services" class="class_checkbox"><label for="test-316-field_5_1">Measuring Services</label></li> | |
<li><input type="checkbox" id="test-316-field_5_2" name="test[]" value="Reporting Services" class="class_checkbox"><label for="test-316-field_5_2">Reporting Services</label></li> | |
<li><input type="checkbox" id="test-316-field_5_3" name="test[]" value="Consulting Services" class="class_checkbox"><label for="test-316-field_5_3">Consulting Services</label></li> | |
</ul> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment