zoukankan      html  css  js  c++  java
  • 弹性盒子 flex-direction

      使用弹性盒子可以更方便的对页面内容进行布局

      flex-direction指定了子元素在父元素盒子中的排列方式

      1.flex-direction:row

        flex默认排列方式,从左到右排列,左对齐

      2.flex-direction:row-reverse

        与row反向,从右向左排列,右对齐,第一个在最右边

      3.flex-direction:column

        从上到下依次排列,向上对齐

      4.flex-direction:column-reverse

        与column相反,从下到上对齐,第一个在最下面

      说明:HTML

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>flex</title>
        <link rel="stylesheet" href="flex.css">
    </head>
    <body>
        <div id="content">
            <div>div1</div>
            <div>div2</div>
            <div>div3</div>
        </div>
    </body>
    </html>

        row:

    #content
    {
        width: 500px;
        height: 500px;
        background: #0395e1;
        display: flex;
        flex-direction: row;
    }
    #content>div
    {
        width: 100px;
        height: 100px;
        margin: 10px;
        background: #e53935;
    }

        样式:

        

        row-reverse:

        

    #content
    {
        width: 500px;
        height: 500px;
        background: #0395e1;
        display: flex;
        flex-direction: row-reverse;
    }
    #content>div
    {
        width: 100px;
        height: 100px;
        margin: 10px;
        background: #e53935;
    }

        样式:

        

        column:

        

    #content
    {
        width: 500px;
        height: 500px;
        background: #0395e1;
        display: flex;
        flex-direction:column;
    }
    #content>div
    {
        width: 100px;
        height: 100px;
        margin: 10px;
        background: #e53935;
    }

        样式:

        

        column-reverse:

        

    #content
    {
        width: 500px;
        height: 500px;
        background: #0395e1;
        display: flex;
        flex-direction:column-reverse;
    }
    #content>div
    {
        width: 100px;
        height: 100px;
        margin: 10px;
        background: #e53935;
    }

        样式:

        

    ╰︶﹉⋛⋋⊱⋋๑๑⋌⊰⋌⋚﹉︶╯
  • 相关阅读:
    matlab:画二维正态分布密度函数图
    几个机器学习上的概念
    相似性度量
    二分图最大匹配问题
    过三关(tictactoe)游戏的LIBSVM解决方法
    关于二分图的一些概念
    用NSZombieEnabled解决恼人的EXC_BAD_ACCESS错误
    SMARTARM2200 ADS工程在IAR EWARM 5.3上的移植(1)启动代码(cstartup.s)分析
    iOS开发-用ZipArchive添加和解压zip包
    iOS程序内进入 App Store 打分的代码
  • 原文地址:https://www.cnblogs.com/zhangcheng001/p/10948985.html
Copyright © 2011-2022 走看看