微信小程序radio单选框如何修改宽高及选中样式 | 您所在的位置:网站首页 › 微信如何换字体样式 › 微信小程序radio单选框如何修改宽高及选中样式 |
之前写过关于多选框设置样式的办法,其实与单选框设置的方法一样,唯一不同的是,在css样式里,/* 选中后的 背景样式 (红色背景 无边框 可根据UI需求自己修改) */的下面定义的css需要加上!important才会生效,意思是本css拥有最高权重,但是多选框就不用,挺逗的。 关于多选框的设置方法:微信小程序checkbox多选框如何修改宽高及选中样式 是 否css代码 /*radio未选中时样式 */ radio .wx-radio-input{ width: 25rpx; height: 25rpx; border-radius: 50%; } /* 选中后的 背景样式 (红色背景 无边框 可根据UI需求自己修改) */ radio .wx-radio-input.wx-radio-input-checked { background: #0394F0 !important; border-color:#0394F0 !important; } /* 选中后的 对勾样式 (白色对勾 可根据UI需求自己修改) */ radio .wx-radio-input.wx-radio-input-checked::before { width: 18rpx; height: 18rpx; line-height: 18rpx; text-align: center; font-size: 22rpx; color: #fff; background: transparent; transform: translate(-50%, -50%) scale(1); -webkit-transform: translate(-50%, -50%) scale(1); }效果: 你可能需要以下内容: uniapp开发微信小程序实现多选全选反选功能 自定义微信小程序单选框宽高颜色等样式 uniapp或原生微信小程序实现单选框(radio) 转载注明出处:http://www.duanlonglong.com/qdjy/956.html |
CopyRight 2018-2019 实验室设备网 版权所有 |