【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;
}  

实现水平垂直居中

posted @ 2015-12-28 15:52  Western Journey  阅读(117)  评论(0编辑  收藏  举报