微信小程序,如何去掉或修改button的边框、圆角

在写微信小程序的时候遇到了这样的问题:

        index.wxml文件设置按钮:

<button>按钮</button>

        index.wxss设置按钮的样式为:

button{
  border:none;
  border-radius:0;
}

发现样式并没有起效果,这是因为微信小程序button的边框、圆角是通过button::after设置的,这样写就能够去掉边框和圆角了:

button::after{
  border: none;
  border-radius: 0;
}

猜你喜欢

转载自blog.csdn.net/Two_Too/article/details/79868282