【css3】flex弹性布局

<div class="box">
  <div class="item"></div>
</div>



.box{
  background-color:orange;
  width:150px;
  height:200px;
  border-radius:15px;
  display:flex;
  box-shadow:0 0 5px #000;
  justify-content:center;
  flex-wrap:wrap;
  align-content:center;
  flex-direction:row;
  align-items:center;
}
.item{
  background-color:#000;
  width:20px;
  height:20px;
  border-radius:15px;
}  

实现水平垂直居中

转载于:https://www.cnblogs.com/positive/p/5082838.html

猜你喜欢

转载自blog.csdn.net/weixin_33797791/article/details/93495857