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>
  • 相关阅读:
    [工具推荐]005.Axure RP Pro 7.0模拟C#TAB控件
    [安卓基础] 008.Android中的显示单位
    [JavaWeb基础] 008.Spring初步配置
    [批处理教程之Shell]002.Linux 常用命令大全
    [注]新手学习编程的最佳方式是什么?
    [C#打包部署教程]001.VS2012 + InstallShield
    [站点推荐]001.学习新技能的37个最佳网站(The 37 Best Websites To Learn Something New)
    程序员如何像写代码一样找女朋友
    [工具-006] C#如何模拟发包登录
    [Linux系统] (1)常用操作(CentOS 7.x)
  • 原文地址:https://www.cnblogs.com/kukai/p/12336158.html
Copyright © 2011-2022 走看看