微信 checkbox修改樣式

https://www.jianshu.com/p/f8d7932006c0web

https://blog.csdn.net/qq_36894527/article/details/83893426spa

https://developers.weixin.qq.com/community/develop/doc/0002c84233032862c6f6bb13256404.net

/*checkbox 總體大小  */
checkbox {
  width: 240rpx;
  height: 90rpx;
}
/*checkbox 選項框大小  */
checkbox .wx-checkbox-input {
  width: 50rpx;
  height: 50rpx;
}
/*checkbox選中後樣式  */
checkbox .wx-checkbox-input.wx-checkbox-input-checked {
  background: #FF525C;
}
/*checkbox選中後圖標樣式  */
checkbox .wx-checkbox-input.wx-checkbox-input-checked::before {
  width: 28rpx;
  height: 28rpx;
  line-height: 28rpx;
  text-align: center;
  font-size: 22rpx;
  color: #fff;
  background: transparent;
  transform: translate(-50%, -50%) scale(1);
  -webkit-transform: translate(-50%, -50%) scale(1);
}

 修改radio樣式code

radio .wx-radio-input{
   border-radius: 50%;/* 圓角 */
   width: 40rpx;
   height: 40rpx;
}
/* 選中後的 背景樣式 (紅色背景 無邊框 可根據UI需求本身修改) */
radio .wx-radio-input.wx-radio-input-checked{
   border: none;
   background: red;
}
/* 選中後的 對勾樣式 (白色對勾 可根據UI需求本身修改) */
radio .wx-radio-input.wx-radio-input-checked::before{
   border-radius: 50%;/* 圓角 */
   width: 40rpx; /* 選中後對勾大小,不要超過背景的尺寸 */
   height: 40rpx; /* 選中後對勾大小,不要超過背景的尺寸 */
   line-height: 40rpx;
   text-align: center;
   font-size:30rpx; /* 對勾大小 30rpx */
   color:#fff; /* 對勾顏色 白色 */
   background: transparent;
   transform:translate(-50%, -50%) scale(1);
   -webkit-transform:translate(-50%, -50%) scale(1);
}
--------------------- 
版權聲明:本文爲CSDN博主「歐巴醬」的原創文章,遵循CC 4.0 by-sa版權協議,轉載請附上原文出處連接及本聲明。
原文連接:https://blog.csdn.net/qq_36894527/article/details/83893426

相關文章
相關標籤/搜索