博主网站(未完善)
博主首页

目录

01图标库
02插件安装

01条件渲染
02列表渲染
03模板渲染
04计算属性
05侦听器
06样式绑定
07样式
08事件
09表单输入绑定
10生命周期
11组件
12脚手架
13vue-router
14vuex
15拖拽
16组件间传递

01HTML元素
02CSS样式

01filter、find……
02匿名函数……
03动态拼接地址
04vh、vm
05vue中ref
06js类型判断
07插槽
08富文本编辑器
09javaScript
10watch监听
11依赖注入
12ES6运算符
13flex-direction
14本地存储
15随机颜色
16中间延申
17多次触发问题
18nvm安装
19表单数据动态
20持久化存储
21$nextTick
22::v-deep
23tab失灵
25封装表单验证
26电梯导航栏
27页面滚动渐入动画

css3基础01

01bs列表
02bs栅格
03bs表单
更新中......

vue---13flex-direction

flex-direction容器属性:

01.简介:

flex-direction属性决定主轴的方向(即项目的排列方向)。

.container {
  flex-direction: row | row-reverse | column | column-reverse;
}
bootstrap中简写:flex-row | flex-column

row(默认值):主轴为水平方向,起点在左端。 row-reverse:主轴为水平方向,起点在右端。 column:主轴为垂直方向,起点在上沿。 column-reverse:主轴为垂直方向,起点在下沿。
justify-content:space-between;均分

 

02.案例

row:(默认值)主轴为水平方向,起点在左端

 <div class="flex-direction">
        <div class="row">
            <p>我是第一个flex-direction:row</p>
        </div>
        <div class="row">
            <p>我是第二个flex-direction:row</p>
        </div>
        <div class="row">
            <p>我是第三个flex-direction:row</p>
        </div>
    </div>




    .flex-direction{
           display: flex;
           display: -webkit-flex;
           flex-direction: row;
           width: 500px;
           height: 200px;
           margin: auto;
       }
       .row{
           width: 150px;
           height: 160px;
           border: 1px  black solid;
           background-color: aqua;
       }

效果图:

 

 

 row-reverse:主轴为水平方向,起点在右端。

 <div class="flex-direction">
        <div class="row_reverse">
            <p>我是第一个flex-direction:row-reverse</p>
        </div>
        <div class="row_reverse">
            <p>我是第二个flex-direction:row-reverse</p>
        </div>
        <div class="row_reverse">
            <p>我是第三个flex-direction:row-reverse</p>
        </div>
    </div>


 .flex-direction{
            display: flex;
            display: -webkit-flex;
            flex-direction: row-reverse;
            width: 500px;
            height: 200px;
            margin: auto;
        }
       .row_reverse{
           width: 150px;
           height: 180px;
           border: 1px #000000 solid;
           background-color: palegoldenrod;
       }

效果图:

 

 

 column:主轴为垂直方向,起点在上沿。

 <div class="flex-direction">
        <div class="column">
            <p>我是第一个flex-direction:column</p>
        </div>
        <div class="column">
            <p>我是第二个flex-direction:column</p>
        </div>
        <div class="column">
            <p>我是第三个flex-direction:column</p>
        </div>
    </div>



    .flex-direction{
            display: flex;
            display: -webkit-flex;
            flex-direction: column;
            width:500px;
            height: 300px;
            margin: auto;
        }
        .column{
            width: 130px;
            height: 280px;
            border: 1px black solid;
            background-color: gold;
        }

效果图:

 

 

 column-reverse:主轴为垂直方向,起点在下沿。

 

 

<div class="flex-direction">
        <div class="column-reverse">
            <p>我是第一个flex-direction:column-reverse</p>
        </div>
        <div class="column-reverse">
            <p>我是第二个flex-direction:column-reverse</p>
        </div>
        <div class="column-reverse">
            <p>我是第三个flex-direction:column-reverse</p>
        </div>
    </div>



   .flex-direction{
            display:flex;
            display: -webkit-flex;
            flex-direction: column-reverse;
            width: 500px;
            height: 300px;
            margin: auto;
        }
        .column-reverse{
            width: 150px;
            height: 200px;
            border: 1px black solid;
            background-color: lawngreen;
        }

效果图:

 

posted @ 2022-01-26 16:51  !ment  阅读(502)  评论(0编辑  收藏  举报