How To modify Checkbox and Radio design?

There ar several choices for modify Checkbox and Radio style. however we’ve a reasonably easy method of modify Checkbox and Radio style.

With the given guidelines you can easily modify Checkbox and Radio design.

1. How To modify Checkbox

(a) Add this HTML:

<label class="custom-checkbox">Checkbox 01
  <input type="checkbox" checked="checked">
  <span class="check-point"></span>
</label>

<label class="custom-checkbox">Checkbox 02
  <input type="checkbox">
  <span class="check-point"></span>
</label>

(b) Add this CSS:

.custom-radiobox {
  display: block;
  position: relative;
  padding-left: 35px;
  margin-bottom: 12px;
  cursor: pointer;
  font-size: 22px;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
.custom-radiobox input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}
.check-point {
  position: absolute;
  top: 0;
  left: 0;
  height: 25px;
  width: 25px;
  background-color: #eee;
  border-radius: 50%;
}
.custom-radiobox:hover input ~ .check-point {
  background-color: #ccc;
}
.custom-radiobox input:checked ~ .check-point {
  background-color: #d22756;
}
.check-point:after {
  content: "";
  position: absolute;
  display: none;
}
.custom-radiobox input:checked ~ .check-point:after {
  display: block;
}
.custom-radiobox .check-point:after {
 	top: 9px;
	left: 9px;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: white;
}

2. How To modify Radiobox

(a) Add this HTML:

<label class="custom-radiobox">Radio 01
  <input type="radio" checked="checked" name="radio">
  <span class="check-point"></span>
</label>
<label class="custom-radiobox">Radio 02
  <input type="radio" name="radio">
  <span class="check-point"></span>
</label>

(b) Add thisCSS:

.custom-radiobox {
  display: block;
  position: relative;
  padding-left: 35px;
  margin-bottom: 12px;
  cursor: pointer;
  font-size: 22px;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
.custom-radiobox input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}
.check-point {
  position: absolute;
  top: 0;
  left: 0;
  height: 25px;
  width: 25px;
  background-color: #eee;
  border-radius: 50%;
}
.custom-radiobox:hover input ~ .check-point {
  background-color: #ccc;
}
.custom-radiobox input:checked ~ .check-point {
  background-color: #d22756;
}
.check-point:after {
  content: "";
  position: absolute;
  display: none;
}
.custom-radiobox input:checked ~ .check-point:after {
  display: block;
}
.custom-radiobox .check-point:after {
  top: 9px;
  left: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: white;
}

Leave a Reply

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