首页 > 其他 > 详细

flexbox + media query 实现响应式布局

时间:2017-02-08 14:37:23      阅读:143      评论:0      收藏:0      [点我收藏+]
  <style type="text/css">
  *{margin: 0; padding: 0;}
  /*body {
  display: flex;
  align-items: center;
  justify-content: center;
   
  flex-wrap: wrap;
  align-content: center;
  }*/
   
  .row {
  display: flex;
  align-items:stretch;
  flex:auto;
  background-color: red;
  }
   
  .item {
  display: flex;
  height: 150px;
  flex:0 0 33%;
  align-items:center;
  justify-content:center;
  border: 1px solid #000;
  }
   
  @media screen and (min-width: 1620px) {
  .row {
  flex-direction: row;
  }
  }
   
  @media screen and (min-width:320px) and (max-width:500px){
  .row {
  flex-direction: column;
  }
  }
   
  @media screen and (max-width:320px){
  .row{
  background-color:blue;
  flex-direction: column-reverse
  }
  }
   
  </style>
   
  <div class="row">
  <div class="item">1</div>
  <div class="item">2</div>
  <div class="item">3</div>
  </div>

flexbox + media query 实现响应式布局

原文:http://www.cnblogs.com/xuezizhenchengxuyuan/p/6377951.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!