<div class="box">
<div class="left">
左边内容
</div>
<div class="right">
右边内容
</div>
</div>
{
.box {
width: 300px;
height: 200px;
display: flex;
background: #eeeeee;
}
.left {
background: #3A71A8;
}
.right {
background: #30B08F;
margin-left: auto; //需要居右的元素
}
原文:https://www.cnblogs.com/bugSource/p/14582170.html