小程序的 button 组件,默认会有边框样式。
<button class="custom-btn" open-type="getUserInfo" @getuserinfo="getUserInfo">获取用户信息</button>
使用如下CSS代码,可以修改 button 组件的默认样式:
.custom-btn {
font-size: 32rpx;
color:rgba(52,144,248,1);
height: 100%;
line-height: 100rpx;
background: transparent;
}
.custom-btn::after {
border-color: transparent;
}
总结:对于button的边框设置,要放在::after里面设置,才能生效,要不然会出现各种怪异现象。对于其它样式,可以直接修改。