首页 > Web开发 > 详细

改变input tpye 属性radio css 样式!!!

时间:2019-05-06 16:58:34      阅读:118      评论:0      收藏:0      [点我收藏+]
// html部分
<div class="Report_for_right">
<input type="radio" name="Report_radio">
<label></label>
</div>
//css
.Report_for_right{
float: right;
position: relative;
input{
z-index: 100;
}
input[type="radio"] {
/*width: 40px;*/
// 这里把默认的圆点透明度设置为0,并且把 label 标签的层级设置成高于默认的radio层级
opacity: 0;
z-index: 100!important;
height: 20px;
}
label {
position: absolute;
right: 10px;
top:12px;
border: 1px solid #ddd;
width: 15px;
height: 15px;
text-align: center;
// 点击显示成绿色部分,其实是radio的部分,只不过对radio进行了透明处理而已。
z-index:1;
/**/
border-radius: 50px;
color: #333;
}
input:checked+label {
background-color: #ff6160;
border-radius: 50px;
color: white;
}
}




注释:如有错误!请留言

改变input tpye 属性radio css 样式!!!

原文:https://www.cnblogs.com/Liu-yz/p/10820280.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!