radio修改默认样式时为什么会有没有设置的颜色?
发布于 5 年前 作者 pxu 13029 次浏览 来自 问答

修改radio的默认样式时,出现了不想要的颜色,但是没找到时哪边影响的

中间那个绿色不知道是怎么出现的

wxml:

<view class="radio_box">
  <radio style="transform:scale(0.7)" value="{{item.value}}"/>
</view>

wxss:

/* 单选按钮样式*/
radio .wx-radio-input {
  width: 40rpx;
  height: 40rpx;
  border: 4rpx solid #999;
  border-radius: 100%;
  background: none;
}

/*单选按钮选中后内部样式*/
radio .wx-radio-input.wx-radio-input-checked {
  border: 4rpx solid #ff3c64!important;
}

radio .wx-radio-input.wx-radio-input-checked::before {
  width: 60%;
  height: 60%;
  background: #ff3c64;
  border-radius: 100%;
  content: '';
  transform: translate(-50%, -50%) scale(1);
  -webkit-transform: translate(-50%, -50%) scale(1);
}

希望的是中间绿色不分是没有颜色的

回到顶部