微信小程序radio样式的颜色及大小设置

image.png
布局wxml
<radio-group bindchange="groupHandler" class="radio-area">
<radio checked="true" value="host">主机</radio>
<radio value="ele" class="ml40">电极</radio>
</radio-group>
样式wxss
radio-group text {
font-size: 25rpx;
// color: #666666;
}
radio .wx-radio-input {
border-radius: 50%; /* 圆角 */
width: 24rpx;
border: 2rpx solid #5e5e5f;
height: 24rpx;
}
radio .wx-radio-input.wx-radio-input-checked {
border: none;
background: #07c160;
}
radio .wx-radio-input.wx-radio-input-checked::before {
border-radius: 50%; /* 圆角 */
width: 28rpx; /* 选中后对勾大小,不要超过背景的尺寸 */
height: 28rpx; /* 选中后对勾大小,不要超过背景的尺寸 */
line-height: 28rpx;
text-align: center;
font-size: 20rpx; /* 对勾大小 30rpx */
color: #fff; /* 对勾颜色 白色 */
background: #07c160;
transform: translate(-50%, -50%) scale(1);
}
本文标题:微信小程序radio样式的颜色及大小设置
本文链接:https://www.haomeiwen.com/subject/epguzrtx.html
网友评论