首页 > 其他 > 详细

第2节 讲解flex布局容器?六?属性之flex-direction

时间:2020-04-05 12:01:13      阅读:91      评论:0      收藏:0      [点我收藏+]
  • flex-direction属性决定主轴的?向

描述
row 默认值。主轴为水平?方向,起点在左边。
row-reverse 主轴为水平?方向,起点在右边。
column 主轴为垂直方向,起点在上面。
column-reverse 主轴为垂直方向,起点在下面。
  • 示例

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <style>
    .flexTest {
      display: flex;
      flex-direction: row;
      height: 1000px;
    }
    .item {
      width: 100px;
      height: 100px;
      margin: 10px;
      background: #c3c3c3;
    }
  </style>
</head>
<body>
  <div class="flexTest">
    <div class="item">1</div>
    <div class="item">2</div>
    <div class="item">3</div>
    <div class="item">4</div>
  </div>
</body>
</html>
  • row

技术分享图片

  • row-reverse

技术分享图片

  • column

技术分享图片

  • column-reverse

技术分享图片

第2节 讲解flex布局容器?六?属性之flex-direction

原文:https://www.cnblogs.com/xl4ng/p/12636188.html

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