如何改变radio的样式
需求:项目中的radio的样式和颜色和 的样式有区别,如何改变呢?通过单纯的修改css可能达不到效果,需要借助html。

input {opacity: 0;
}
label {display: flex;justify-content: center;align-items: center;
}
.out-span {width: 18px;height: 18px;border: 1px solid #000;border-radius: 50%;display: flex;justify-content: center;align-items: center;margin-right: 11px;cursor: pointer;
}
inner-span {width: 10px;height: 10px;display: inline-block;border: 1px solid #000;border-radius: 50%;background: #000;
}// label 中的for属性和input中的id属性是对应的
// 内部的span负责选中的样式,外部的span负责未选中的边框样式
// 设置input的opacity为0
本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!
