微信小程序:如何让按钮button中的文字居中
作者:互联网
效果
wxml
<button type="primary" form-type='submit'>登录</button>
wxss
添加如下样式:
button[type="primary"] { display:flex; align-items: center; justify-content: center; }
所有样式如下:
button[type="primary"] { display:flex; align-items: center; justify-content: center; height: 40px; line-height: 40px; font-size: 36rpx; text-align: center; background-color: #007AFF !important; margin-top: 20px; margin-bottom: 20px; color: #FFFFFF; border-radius: 10px; }
效果如下
标签:40px,center,color,微信,align,primary,按钮,button 来源: https://www.cnblogs.com/zwh0910/p/15602022.html