پیش‌نمایش زنده
کد HTML
<label class="container">
  <input type="checkbox" checked="checked">
  <div class="checkmark"></div>
</label>
کد CSS
/* 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.3em;
 width: 1.3em;
 background-color: #fff;
 transition: all 0.5s;
}

/* When the checkbox is checked, add a blue background */
.container input:checked ~ .checkmark {
 border: 2px solid #080;
}

/* 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.55em;
 top: -0.15em;
 width: 0.35em;
 height: 0.7em;
 border: solid #080;
 border-width: 0 0.25em 0.25em 0;
 transform: rotate(45deg);
 transition: all 0.5s;
}
نوع: checkbox
تاریخ ایجاد: 2026/06/05
آخرین بروزرسانی: 2026/06/05