相关疑难解决方法(0)

使用自定义设计设置为隐藏时,复选框选项卡索引不起作用

我正在使用复选框并使用CSS为其添加自定义设计

label {
  position: relative;
  margin-bottom: 0.5em; }

.input-field {
  width: 100%;
  border: 1px solid #ecf0f1;
  padding: 0.5em;
 }

input[type="radio"],
input[type="checkbox"] {
  display: none; 
}

input[type="checkbox"] + label {
  padding-left: 1.5em; 
}

input[type="checkbox"] + label:before {
  position: absolute;
  left: 0;
  top: 4px;
  content: "";
  width: 1em;
  height: 1em;
  border: 1px solid rgba(0, 0, 0, 0.25); 
}

input[type="checkbox"]:focus,
input[type="checkbox"]:checked + label:before {
  content: "\2713"; /* "?" */ 
}
Run Code Online (Sandbox Code Playgroud)

但问题是,当使用带有Tab键的键盘导航表单时,将忽略复选框.如何将其包含在导航流程中?

演示

html css checkbox

12
推荐指数
1
解决办法
1万
查看次数

标签 统计

checkbox ×1

css ×1

html ×1