微信小程序如何去掉含有子控件的button边框,小程序这边的样式会给你button添加一个默认的边框,具体可以去看样式源码
网上大部分的方法都是通过伪元素来做的
.button::after {
border: none;
}

但是这个方法对于简单的button是有效的,当button中包含子控件的时候,也是就将 plain=true的时候
<button class="button" open-type="contact" plain="true">
<image src="/static/xxx.png" mode="widthFix"></image>
<text>客服</text>
</button>

还需要这样设置一下,让button在plain="true"的清空下,也得没有边框
.button[plain] {
border:none;
}

网友评论