直接看代码就可以了吧
<div class="a">a</div>
<div class="flex">flex</div>
div {
height: 300px;
width: 300px;
background-color: #ededed;
margin-top: 20px;
}
.a {
text-align: center;
line-height: 300px;
}
.flex {
display: flex;
/* flex-direction: column; */
justify-content: center;
align-items: center;
}