如下:
justify-content 的使用(弹性子元素在父容器中的位置)
盒子居中显示

<style>
.box{
display: flex;
width: 300px;
background-color:gray;
justify-content: center;
}
.box div{
width: 120px;
height: 100px;
margin: 10px;
background-color: blue;
text-align: center;
}
</style>
<body>
<div class="box">
<div>盒子1</div>
<div >盒子2</div>
<div>盒子3</div>
</div>
</body>
弹性盒子
原文:https://www.cnblogs.com/chengdu123/p/11523265.html