小编Pix*_*ter的帖子

自定义复选框/单选按钮焦点

我使用以下方法创建了自定义复选框/单选按钮:

<label class="container">One
  <input type="checkbox" checked="checked">
  <span class="checkmark"></span>
</label>

<label class="container">Two
  <input type="checkbox">
  <span class="checkmark"></span>
</label>

<label class="container">Three
  <input type="checkbox">
  <span class="checkmark"></span>
</label>

<label class="container">Four
  <input type="checkbox">
  <span class="checkmark"></span>
</label> 
Run Code Online (Sandbox Code Playgroud)
/* Customize the label (the container) */
.container {
  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;
}

/* Hide the browser's default checkbox */
.container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0; …
Run Code Online (Sandbox Code Playgroud)

css checkbox usability radio-button

2
推荐指数
1
解决办法
4041
查看次数

标签 统计

checkbox ×1

css ×1

radio-button ×1

usability ×1