正在加载中...

信息详页

返回
input radio 不显示如何解决


来源:本站 浏览量:88 次 发布日期:2022-07-07

HTML中type="radio" 但是在界面中不显示。查看css,使用到了全局
input{-webkit-appearance:none;}
导致type=“radio”应该显示的小圆圈不显示了。或者说使input失效了

解决方案,可自定义CSS进行处理,CSS方案如下:

<style> 

input[type="radio"]{
-webkit-appearance:none;
Dwidth: 16px;
Dheight: 16px;
background: #FFFFFF;
border-radius: 30%;
border: 2px solid #9f9f9e;
}
input[type="radio"]:checked{
background: #a6b811;
border-radius: 100%;
}
input[type="radio"]:checked + span{
color: #FFFFFF;
}
input[type="checkbox"]{
-webkit-appearance:none;
Dwidth: 16px;
Dheight: 16px;
background: #FFFFFF;
border-radius: 30%;
border: 2px solid #9f9f9e;
}
input[type="checkbox"]:checked{
background: #6adbfb;
border-radius: 100%;
}
input[type="checkbox"]:checked + span{
color: red;
}
</style>