小程序-修改radio及checkbox的选中背景色

 

 

一:将默认多选框checkbox的默认选中背景红色改为绿色

checkbox .wx-checkbox-input{

  border-radius:50%;

  width:20px;height:20px;

}
checkbox .wx-checkbox-input.wx-checkbox-input-checked{

  border-color:#07c160 !important;

  background:#07c160 !important;

}
checkbox .wx-checkbox-input.wx-checkbox-input-checked::before{

  border-radius:50%;

  width:20px;

  height:20px;

  line-height:20px;

  text-align:center;

  font-size:15px;

  color:#fff;

  background:transparent;

  transform:translate(-50%, -50%) scale(1);

  -webkit-transform:translate(-50%, -50%) scale(1);

}

  

 

二:将radio默认选中的红色改为绿色

radio .wx-radio-input{

  border-radius:50%;

  width:20px;

height:20px; } radio .wx-radio-input.wx-radio-input-checked{ border-color:#07c160 !important; background:#07c160 !important; } radio .wx-radio-input.wx-radio-input-checked::before{ border-radius:50%; width:20px; height:20px; line-height:20px; text-align:center; font-size:15px; color:#fff; background:transparent; transform:translate(-50%, -50%) scale(1); -webkit-transform:translate(-50%, -50%) scale(1); }

  

 

posted @ 2021-10-26 14:54  MiniDuck  阅读(2568)  评论(0编辑  收藏  举报