一、修改前
- 效果
<button bindtap="saveInfo">保存</button>
button {
text-align: center;
margin-top: 30px;
color: #FFF;
background-color: #2e79fc !important;
border-radius: 10px;
height: 60px;
line-height: 40px;
width: 70%;
}
二、修改后
- 效果
button {
display:flex;
align-items: center;
justify-content: center;
text-align: center;
margin-top: 30px;
color: #FFF;
background-color: #2e79fc !important;
border-radius: 10px;
height: 60px;
line-height: 40px;
width: 70%;
}
文章来源地址https://www.toymoban.com/news/detail-512537.html
文章来源:https://www.toymoban.com/news/detail-512537.html
到了这里,关于微信小程序:如何让button中的文字居中的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!