flex—骰子一点
<div class="box">
<div class="item"></div>
</div>
.box{
height: 80px;
width: 80px;
background-color: wheat;
border-radius: 10px;
display: flex;
justify-content: center;
align-items: center;
}
.item{
height: 15px;
width: 15px;
background-color: red;
border-radius: 50%;
}
不用align-items也行,给弹性元素设置 align-self: center