zoukankan      html  css  js  c++  java
  • flex弹性盒里order属性示例

    <!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>
            .box{
                 800px;
                height: 800px;
                border: 2px solid red;
                display: flex;
            }
            .box div{
                 200px;
                height: 200px;
                background-color: chartreuse;
                font-size: 50px;
                text-align: center;
                line-height: 200px;
                /* 可以设置元素的三个样式(弹性盒的三个状态)  增长(flex-grow) 缩减(flex-shrink) 基础(静止时弹簧的长度 flex-base) */
                flex:1 0 auto;
                /* order 决定弹性元素的排列顺序,数字越小,越靠前 */
                order: 3;
            }
            .box div:nth-child(2){
                background-color: coral;
                order:0;
            }
            .box div:nth-child(3){
                background-color: darkkhaki;
                order:5;
            }
        </style>
    </head>
    <body>
        <div class="box">
            <div class="box1">1</div>
            <div class="box2">2</div>
            <div class="box3">3</div>
        </div>
    </body>
    </html>
  • 相关阅读:
    POJ1417 True Liars
    POJ2912 Rochambeau
    POJ3904 Sky Code
    [SDOI2016]排列计数
    POJ2947 Widget Factory
    HDU5015 233 Matrix
    Problem 2242. -- [SDOI2011]计算器
    POJ2480 Longge's problem
    Problem 2818. -- Gcd
    LA3510 Pixel Shuffle
  • 原文地址:https://www.cnblogs.com/kukai/p/12367988.html
Copyright © 2011-2022 走看看