zoukankan      html  css  js  c++  java
  • flex属性介绍

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Document</title>
        <style>
            .outer{
                 300px;
                border: 2px solid red;
                line-height: 100px;
                text-align: center;
                /* 设置元素为弹性容器 */
                display: flex;
                /* 设置弹性元素是否在弹性容器中自动换行 
                   可选值: nowrap 默认值 元素不会自动换行
                           wrap 元素沿辅轴方向自动换行*/
                flex-wrap: nowrap;
                /* 弹性元素在容器中反向水平排列 
                        可选值:row 默认值 水平排列 从左到右 根据国家的书写习惯而定
                               row-reverse 弹性元素在容器中反向水平排列
                               column 弹性元素纵向排列(自上向下)
                               column-reverse 弹性元素 反向纵向排列(自下向上)*/
                flex-direction: column-reverse;
        
            }
            .outer div{
                 200px;
                height: 100px;
                background-color: burlywood;
                /* 指定弹性元素的收缩系数
                  0表示不收缩 */
                /* flex-shrink: 0; */
                
            }
            .outer .box2{
                background-color: chartreuse;
            }
            .outer .box3{
                background-color: darkgoldenrod;
            }
        </style>
    </head>
    <body>
        <div class="outer">
            <div class="box1">111</div>
            <div class="box2">222</div>
            <div class="box3">333</div>
        </div>
    </body>
    </html>
  • 相关阅读:
    Set Matrix Zeroes
    Summary Ranges
    Triangle
    MongoDB基本使用
    PHP Liunx 服务安全防范方案
    linux lvs 配置
    Linux下cacti的安装
    linux_nmon监控方法
    linux下rsync命令详细整理
    虚拟机安装CentOS以及SecureCRT设置【完美无错版】
  • 原文地址:https://www.cnblogs.com/kukai/p/12336158.html
Copyright © 2011-2022 走看看