پیش‌نمایش زنده
کد HTML
<label class="container">
  <input type="checkbox" checked="checked">
  <div class="checkmark"></div>
</label>
کد CSS
.container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.container {
  position: relative;
  cursor: pointer;
  font-size: 17px;
  width: 2em;
  height: 2em;
  user-select: none;
  border: 5px solid white;
  display: block;
}

.checkmark {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.checkmark:after {
  content: '';
  position: absolute;
  top: 25%;
  left: 25%;
  background-color: white;
  width: 50%;
  height: 50%;
  transform: scale(0);
  transition: .1s ease;
}

.container input:checked ~ .checkmark:after {
  transform: scale(1);
}
نوع: checkbox
تاریخ ایجاد: 2026/06/05
آخرین بروزرسانی: 2026/06/05