在微信小程序开发中最常见的布局即为flex布局,在flex布局中我们知道两边对齐可以用 justify-content: space-between;css样式实现,但是在处理button方面上butoon始终不能靠边对齐。解决方法如下(在button样式中加个margin-right: 0;即可):

.flex-row{  display: flex;    flex-direction: row;    align-items: center;}.carbin-item{  width: 90%;  justify-content: space-between;  padding: 20rpx;  border-bottom: solid #eee 2rpx;  font-size: 11pt;}.carbin-item button{  font-size: 11pt;  width:40%;  margin-right: 0;}微信小程序

TAG标签: 微信小程序微信小程序布局

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