flex布局有办法让两个子元素A和B,A居中,B靠右显示嘛?
2条回答 默认 最新
- 你好!机器人 2021-12-14 14:25关注
<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>
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报