CSS对单选按钮样式的修改

CSS使单选按钮变为普通button的样子选中变色

效果图

css

*{
margin: 0;
padding: 0;
}
body{
background: #f1f1f1;
}
li{
list-style: none;
}
.item {
width: 80px;
height: 44px;
line-height: 44px;
font-size: 15px;
overflow: hidden;
float: left;
text-align: center;
margin-bottom: 10px;
}
.item .type {
height: 41px;
line-height: 41px;
text-align: center;
background-color: #fff;
font-size: 15px;
display: block;
margin: 0 5px;
}
.radio {
position: absolute;
top: -9999px;
}
.item .type span {
height: 39px;
display: block;
border: 1px solid #fff;
display: block;
position: relative;
}
.item .radio:checked ~ span {
color: #74c742;
border-color: #74c742;
}

请选择教授的科目:

发布了6 篇原创文章 · 获赞 9 · 访问量 1229

猜你喜欢

转载自blog.csdn.net/zhj52666/article/details/92765446