flex布局有办法让两个子元素A和B,A居中,B靠右显示嘛?
<style>
.main{
background-color: #d7d7d7;
width: 100%;
display: flex;
height: 60rpx;
padding:0 20rpx;
line-height: 60rpx;
}
.item_wrap{
flex: 1;
}
.center{
text-align: center;
}
.right{
text-align: right;
}
</style>
<div class="main">
<div class="item_wrap"></div>
<div class="item_wrap">
<div class="center">aaa</div>
</div>
<div class="item_wrap right">bbb</div>
</view>
这种就不用flex就行吧,float:right,剩下居中的用flex居中不可以吗