小程序修改checkbox样式

 1 /* 未选中的 背景样式 */
 2 checkbox .wx-checkbox-input{
 3   border-radius: 50%;/* 圆角 */
 4   width: 46rpx; /* 背景的宽 */
 5   height: 46rpx; /* 背景的高 */
 6 }
 7 /* 选中后的 背景样式 (红色背景 无边框 可根据UI需求自己修改) */
 8 checkbox .wx-checkbox-input.wx-checkbox-input-checked{
 9   border: 1rpx solid #FF783B;
10   background: #FF783B;
11 }
12 /* 选中后的 对勾样式 (白色对勾 可根据UI需求自己修改) */
13 checkbox .wx-checkbox-input.wx-checkbox-input-checked::before{
14   border-radius: 50%;/* 圆角 */
15   width: 40rpx;/* 选中后对勾大小,不要超过背景的尺寸 */
16   height: 40rpx;/* 选中后对勾大小,不要超过背景的尺寸 */
17   line-height: 40rpx;
18   text-align: center;
19   font-size:30rpx; /* 对勾大小 30rpx */
20   color:#fff; /* 对勾颜色 白色 */
21   background: transparent;
22   transform:translate(-50%, -50%) scale(1);
23   -webkit-transform:translate(-50%, -50%) scale(1);
24 }

直接复制到样式文件中即可,在网上查到的!

posted @ 2020-01-07 15:25  vegetbaleBrid  阅读(874)  评论(0编辑  收藏  举报