首页 > 其他 > 详细

flex--伸缩盒子布局---等分

时间:2019-09-20 23:22:49      阅读:142      评论:0      收藏:0      [点我收藏+]
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Flex demo 2</title>
  <style>
    .container {
      display: flex;
      flex-direction: column;/*改变主轴方向,column列从上往下,默认是row行从左往右*/
      width: 400px;
      height: 300px;
      border: 1px solid #ccc;
    }

    .item {
      flex: 1;
    }
    /* 总的是4份,每一项占一份 */
  </style>
</head>
<body>
  <div class="container">
    <div class="item" style="background-color: #0ff; width: 200px"></div>
    <div class="item" style="background-color: #ff0"></div>
    <div class="item" style="background-color: #f00"></div>
    <div class="item" style="background-color: #f0f"></div>
    <div class="item" style="background-color: #0ff"></div>
  </div>
</body>
</html>

  

flex--伸缩盒子布局---等分

原文:https://www.cnblogs.com/fdxjava/p/11559974.html

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