美文网首页
2018-04-26 微信小程序 button border

2018-04-26 微信小程序 button border

作者: 山北边的人 | 来源:发表于2018-04-26 11:22 被阅读0次

小程序button在设置border:0以及border:none后均无效果,尝试在两种方法后加!important 也无效果

后来发现button控件上有一个伪元素(::after),继而发现这元素上有一个border属性,默认为 border:1px solid rgba(0, 0, 0, 0.2),虽然显示被划线,但功能在执行(钩钩打上了)。

所以问题解决了,border:none属性不是没效果,是被button::after 给覆盖了,只要把button::after 的border 属性去掉就可以了,具体代码如下:

button[class="className"]::after {

    border: 0;

}

相关文章

网友评论

      本文标题:2018-04-26 微信小程序 button border

      本文链接:https://www.haomeiwen.com/subject/feeplftx.html