小程序如何含有子控件的button的边框

2020-12-27  本文已影响0人  helang1991

微信小程序如何去掉含有子控件的button边框,小程序这边的样式会给你button添加一个默认的边框,具体可以去看样式源码

网上大部分的方法都是通过伪元素来做的

.button::after {
    border: none;
}
image.gif

但是这个方法对于简单的button是有效的,当button中包含子控件的时候,也是就将 plain=true的时候

<button class="button" open-type="contact" plain="true">
   <image src="/static/xxx.png" mode="widthFix"></image>
   <text>客服</text>
</button>
image.gif

还需要这样设置一下,让button在plain="true"的清空下,也得没有边框

.button[plain] {
  border:none;
}
image.gif
上一篇 下一篇

猜你喜欢

热点阅读