小程序自带的button组件是有点击效果的,但是一旦自定义了class你发现 他就是一个方块,点了也是那样静静的呆在那里,没有视觉点击感……往往大多数情况下,我们都要自己定义按钮样式于是自己写了一套通用的小程序点击按钮效果app.sxss

.btn-hover{  position: relative;  top: 3rpx;  box-shadow:0px 0px 8px #999 inset; }//镂空按钮 点击阴影不宜太深.plain-hover{  position: relative;  top: 3rpx;  box-shadow:0px 0px 10px #bbbec4 inset; }

button

button class="login-btn" hover-class="btn-hover"登陆/buttonbutton class="register-btn" hover-class="plain-hover"立即注册/button

终于不再那么死板……

转载自:https://blog.csdn.net/weixin_42275932/article/details/83859013

TAG标签: 微信小程序点击按钮

http://www.xiaochengxub.com/read-103021.html