galaxy/Checkboxes/Praashoo7_tough-skunk-14.html

67 lines
1.2 KiB
HTML

<label class="container">
<input checked="checked" type="checkbox">
<div class="checkmark"></div>
</label>
<style>
/* From Uiverse.io by Praashoo7 - Tags: checkbox */
/* Hide the default checkbox */
.container input {
position: absolute;
opacity: 0;
cursor: pointer;
height: 0;
width: 0;
}
.container {
display: block;
position: relative;
cursor: pointer;
font-size: 20px;
user-select: none;
}
/* Create a custom checkbox */
.checkmark {
position: relative;
top: 0;
left: 0;
height: 1.34em;
width: 1.3em;
background-color: #ccc;
transition: .4s ease-in-out;
border-radius: 50%;
}
.checkmark:hover {
background-color: grey;
}
/* When the checkbox is checked, add a blue background */
.container input:checked ~ .checkmark {
background-color: #2196F3;
}
/* Create the checkmark/indicator (hidden when not checked) */
.checkmark:after {
content: "";
position: absolute;
display: none;
}
/* Show the checkmark when checked */
.container input:checked ~ .checkmark:after {
display: block;
}
/* Style the checkmark/indicator */
.container .checkmark:after {
left: 0.25em;
top: 0.29em;
width: 0.50em;
height: 0.50em;
border: solid white;
background-color: white;
border-radius: 50%;
}
</style>