码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2019-09-20 22:58:07      阅读:108      评论:0      收藏:0      [点我收藏+]

标签:isp   默认   lex   direct   tle   doctype   utf-8   head   pre   

<!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--伸缩盒子布局---等分

标签:isp   默认   lex   direct   tle   doctype   utf-8   head   pre   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!