⼩程序flex-row布局中button的问题
在⼩程序开发中最常见的布局即为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%;
flex布局对齐方式margin-right: 0;
}