Coder Wrap provides free to use snippets Coder Wrap provides free to use snippets

Back to Common
Preview Source Code
Download
HTML
CSS
/**Typeo CSS Start**/
	@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');
	*{ box-sizing: border-box;}

	body {
	  font-family: "Poppins", sans-serif;
	  color: #444;
	  box-sizing: border-box;
	  background-color: #f5f5f5;
	  margin: 0px;
	}
	.checkboxgroup {padding: 20px;}
	.checkboxgroup h3{
		color: #000;
		font-size: 20px;
		margin: 0px 0px 20px 0px;
	}
	

	.cw-checkbox-item {
	  margin: 0 0 15px 0;
	  padding: 0;
	}
	.checkboxgroup-main {
    display: flex;
    flex-flow: row wrap;
    align-items: flex-start;
    justify-content: center;
    max-width: 1200px;
    margin: 20px auto;
}

.checkboxgroup-main .checkboxgroup {
    width: 33.3%;
}
@media (max-width: 992px) {
	.checkboxgroup-main .checkboxgroup {
    width: 100%;
    padding: 10px 0px;
}
}
/**Typeo CSS End**/

/**Checkbox Option 1 end**/
.cw-md-checkbox {
    z-index: 0;
    position: relative;
    display: inline-block;
}

/* Input */
.cw-md-checkbox > input {
    appearance: none;
    -moz-appearance: none;
    -webkit-appearance: none;
    z-index: -1;
    position: absolute;
    left: -7px;
    top: -8px;
    display: block;
    margin: 0;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    background-color: rgba( 0, 0, 0, 0.6);
    box-shadow: none;
    outline: none;
    opacity: 0;
    transform: scale(1);
    pointer-events: none;
    transition: opacity 0.3s, transform 0.2s;
}

.cw-md-checkbox > span {
    display: inline-block;
    width: 100%;
    cursor: pointer;
}

.cw-md-checkbox > span::before {
    content: "";
    display: inline-block;
    box-sizing: border-box;
    margin: 0px 11px 3px 1px;
    border: solid 2px;
    border-color: rgba( 0, 0, 0, 0.6);
    border-radius: 2px;
    width: 24px;
    height: 24px;
    vertical-align: top;
    transition: border-color 0.2s, background-color 0.2s;
}

/* Checkmark */
.cw-md-checkbox > span::after {
    content: "";
    display: block;
    position: absolute;
    top: 2px;
    left: 4px;
    width: 10px;
    height: 5px;
    border: solid 2px transparent;
    border-right: none;
    border-top: none;
    transform: translate(3px, 4px) rotate(-45deg);
}

/* Checked, Indeterminate */
.cw-md-checkbox > input:checked,
.cw-md-checkbox > input:indeterminate {
    background-color: rgb(33, 150, 243);
}

.cw-md-checkbox > input:checked + span::before,
.cw-md-checkbox > input:indeterminate + span::before {
    border-color: rgb( 33, 150, 243);
    background-color: rgb(33, 150, 243);
}

.cw-md-checkbox > input:checked + span::after,
.cw-md-checkbox > input:indeterminate + span::after {
    border-color: rgb(255, 255, 255);
}

.cw-md-checkbox > input:indeterminate + span::after {
    border-left: none;
    transform: translate(4px, 3px);
}

/* Hover, Focus */
.cw-md-checkbox:hover > input {
    opacity: 0.04;
}

.cw-md-checkbox > input:focus {
    opacity: 0.12;
}

.cw-md-checkbox:hover > input:focus {
    opacity: 0.16;
}

/* Active */
.cw-md-checkbox > input:active {
    opacity: 1;
    transform: scale(0);
    transition: transform 0s, opacity 0s;
}

.cw-md-checkbox > input:active + span::before {
    border-color: rgb(33, 150, 243);
}

.cw-md-checkbox > input:checked:active + span::before {
    border-color: transparent;
    background-color: rgba(0, 0, 0, 0.6);
}

/* Disabled */
.cw-md-checkbox > input:disabled {
    opacity: 0;
}

.cw-md-checkbox > input:disabled + span {
    color: rgba( 0, 0, 0, 0.38);
    cursor: initial;
}

.cw-md-checkbox > input:disabled + span::before {
    border-color: currentColor;
}

.cw-md-checkbox > input:checked:disabled + span::before,
.cw-md-checkbox > input:indeterminate:disabled + span::before {
    border-color: transparent;
    background-color: currentColor;
}
/**Checkbox Option 1 end**/
/**Checkbox Option 2 start**/
	.cw-label {
	  position: relative;
	  color: #000;
	  margin: 0.5rem;
	  font-family: Arial, sans-serif;
	  line-height: 135%;
	  cursor: pointer;
	}

	.cw-checkbox {
	  position: relative;
	  top: -0.25rem;
	  margin: 0 1rem 0 0;
	  cursor: pointer;
	}
	.cw-checkbox:before {
	  transition: transform 0.4s cubic-bezier(0.45, 1.8, 0.5, 0.75);
	  transform: rotate(-45deg) scale(0, 0);
	  content: "";
	  position: absolute;
	  left: 0.28rem;
	  top: 0.3rem;
	  z-index: 1;
	  width: 0.75rem;
	  height: 0.375rem;
	  border: 2px solid #999;
	  border-top-style: none;
	  border-right-style: none;
	}
	.cw-checkbox:checked:before {
	  transform: rotate(-45deg) scale(1, 1);
	}
	.cw-checkbox:after {
	  content: "";
	  position: absolute;
	  top: 0;
	  left: 0;
	  width: 1rem;
	  height: 1rem;
	  background: #fff;
	  border: 1px solid #999;
	  padding: 0.2em;
	  cursor: pointer;
	  border-radius: 2px;
	}
	.cw-label input[type=checkbox]:disabled + span {
		opacity: 0.50;
	}
/**Checkbox Option 2 end**/
/**Checkbox Option 3 start**/
.md-checkbox {
  position: relative;
  margin: 1em 0;
  text-align: left;
}
.md-checkbox label {
  cursor: pointer;
  display: inline;
  line-height: 1.50em;
  vertical-align: top;
  clear: both;
  padding-left: 12px;
}

.md-checkbox label:before, .md-checkbox label:after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
}
.md-checkbox label:before {
  width: 1.25em;
  height: 1.25em;
  background: #fff;
  border: 2px solid rgba(0, 0, 0, 0.54);
  border-radius: 0.125em;
  cursor: pointer;
  transition: background 0.3s;
}
.md-checkbox input[type=checkbox] {
  outline: 0;
  visibility: hidden;
  width: 1.25em;
  margin: 0;
  display: block;
  float: left;
  font-size: inherit;
}
.md-checkbox input[type=checkbox]:checked + label:before {
  background: #337ab7;
  border: 2px solid #337ab7;
}
.md-checkbox input[type=checkbox]:checked + label:after {
  transform: translate(0.25em, 0.3365384615em) rotate(-45deg);
  width: 0.75em;
  height: 0.375em;
  border: 0.125em solid #fff;
  border-top-style: none;
  border-right-style: none;
  margin-left: 1px;
}

.md-checkbox input[type=checkbox]:disabled + label {
	opacity: 0.50;
	pointer-events: none;
}
.md-checkbox input[type=checkbox]:disabled:checked + label:before {
  background: rgba(0, 0, 0, 0.26);
}
/**Checkbox Option 3 end**/
/**Checkbox Option 4 start**/
.cw-label-checkbox {
  position: relative;
  margin: 0.5rem;
  cursor: pointer;
  padding-left: 30px;
}
.cw-label-checkbox .cw-gm-checkbox {
	opacity: 0;
	position: absolute;
	left: 0px;
	top:0px;
}
.cw-label-checkbox .cw-gm-checkbox:disabled + span {
	opacity: 0.5;
}
.cw-label-checkbox span:before {
  -webkit-transition: all 0.3s ease-in-out;
  -moz-transition: all 0.3s ease-in-out;
  transition: all 0.3s ease-in-out;
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  z-index: 1;
  width: 1rem;
  height: 1rem;
  border: 2px solid transparent;
  opacity: 0;
}

.cw-label-checkbox .cw-gm-checkbox:checked + span:before {
  -webkit-transform: rotate(-45deg);
  -moz-transform: rotate(-45deg);
  -ms-transform: rotate(-45deg);
  -o-transform: rotate(-45deg);
  transform: rotate(-45deg);
  height: 0.5rem;
  border-color: #009688;
  border-top-style: none;
  border-right-style: none;
  opacity: 1;
}

.cw-label-checkbox span:after {
    content: "";
    position: absolute;
    top: -0.125rem;
    left: 0;
    width: 20px;
    height: 20px;
    cursor: pointer;
    border: #adadad 2px solid;
    -webkit-transition: all 0.3s;
  -moz-transition: all 0.3s;
  transition: all 0.3s;
}
.cw-gm-checkbox:checked + span:after {
	opacity: 0;
}
/**Checkbox Option 4 end**/
/**Checkbox Option 5 start**/
.cw-yesno-label-checkbox {
    position: relative;
    display: flex;
    flex-flow: row wrap;
    align-items: center;
}
.cw-yesno-label-checkbox input {
	position: absolute;
	left: 0px;
	top: 0px;
	opacity: 0;
}
.cw-yesno-label-checkbox span{
  width: 80px;
  height: 30px;
  border: #ccc 2px solid;
  border-radius: 25px;
  cursor: pointer;
  position: relative;
  display: inline-block;
  margin: 0px 8px;
}
.cw-yesno-label-checkbox small {
    font-size: 16px;
    cursor: pointer;
}
.cw-yesno-label-checkbox span::after{
  content: '';
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background-color: #000;
  display: block;
  position: absolute;
  top: 3px;
  left: 6px;
  transition: left .3s;
}
.cw-yesno-label-checkbox input:checked + span::after{
  left: calc(100% - 26px);
}
/**Checkbox Option 5 end**/
/**Checkbox Option 6 start**/
.cw-toggle-label-checkbox {position: relative;}
.cw-toggle-label-checkbox input {
	position: absolute;
	left: 0px;
	top: 0px;
	opacity: 0;
}
.cw-toggle-label-checkbox span{
  width: 80px;
  height: 30px;
  background-color: #ddd;
  border-radius: 25px;
  transition: background .6s;
  cursor: pointer;
  position: relative;
  display: inline-block;
}
.cw-toggle-label-checkbox span::after{
  content: '';
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background-color: #fff;
  display: block;
  position: absolute;
  top: 5px;
  left: 6px;
  transition: left .3s;
}
.cw-toggle-label-checkbox input:checked + span{
  background: green;
}
.cw-toggle-label-checkbox input:checked + span::after{
  left: calc(100% - 26px);
}
/**Checkbox Option 6 end**/

Related Snippets

Leave a comment

Your email address will not be published. Required fields are marked *