Created
May 13, 2020 14:02
-
-
Save jericbas/b863e46bb58ff6f7d7e238fc643d78d2 to your computer and use it in GitHub Desktop.
Custom css
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
<h3>Checkboxes</h3> | |
<div> | |
<input id="checkbox-1" class="checkbox-custom" name="checkbox-1" type="checkbox"> | |
<label for="checkbox-1" class="checkbox-custom-label">First Choice</label> | |
</div> |
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
.checkbox-custom { | |
display: none; | |
} | |
.checkbox-custom-label { | |
display: inline-block; | |
position: relative; | |
vertical-align: middle; | |
margin: 5px; | |
cursor: pointer; | |
} | |
.checkbox-custom + .checkbox-custom-label:before { | |
content: ''; | |
background: #fff; | |
border-radius: 5px; | |
border: 2px solid #ddd; | |
display: inline-block; | |
vertical-align: middle; | |
width: 10px; | |
height: 10px; | |
padding: 2px; | |
margin-right: 10px; | |
text-align: center; | |
} | |
.checkbox-custom:checked + .checkbox-custom-label:after { | |
content: ""; | |
padding: 2px; | |
text-align: center; | |
position: absolute; | |
width: 1px; | |
height: 5px; | |
border: solid blue; | |
border-width: 0 3px 3px 0; | |
transform: rotate(45deg); | |
-webkit-transform: rotate(45deg); | |
-ms-transform: rotate(45deg); | |
top: 2px; | |
left: 5px; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment