修改后
使用伪类选择器修改radio的默认背景色
修改后
使用伪类选择器修改radio的默认背景色
页面
使用伪类选择器修改radio的默认背景色

//使用伪类覆盖单选框的样式
.radio_type {
width: 20px;
height: 20px;
appearance: none;
position: relative;
outline: none;
}
.radio_type:before {
content: ‘’;
width: 10px;
height: 10px;
border: 1px solid #00f0ff;
display: inline-block;
border-radius: 50%;
vertical-align: middle;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.radio_type:checked:before {
content: ‘’;
width: 10px;
height: 10px;
border: 1px solid #00f0ff;
display: inline-block;
border-radius: 50%;
vertical-align: middle;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.radio_type:checked:after {
content: ‘’;
width: 6px;
height: 6px;
text-align: center;
background: #00f0ff;
border-radius: 50%;
display: block;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}

使用伪类选择器修改radio的默认背景色

相关文章:

  • 2022-12-23
  • 2022-02-05
  • 2021-11-20
  • 2021-04-04
  • 2022-12-23
  • 2021-05-24
  • 2021-07-21
  • 2021-11-20
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-13
  • 2021-09-25
  • 2022-12-23
  • 2021-05-26
相关资源
相似解决方案