HTML:
<div class="father">
<div class="son"></div>
<div class="son"></div>
</div>
CSS:
.father {
display: flex;
justify-content: space-between;
align-items: center;
background-color: aqua;
width: 200px;
height: 100px;
}
.son {
background-color: chocolate;
width: 50px;
height: 50px;
}
运行结果: