flex子元素属性

 <style>
        div {
            display: flex;
            width: 100%;
            height: 500px;
        }

        span {
            width: 200px;
            height: 200px;
            background-color: aquamarine;
        }

        span:nth-child(2) {
            /* 设置第二个span独占剩余空间 */
            flex: 1;
            /* 设置第二个元素排列顺序 默认order为1 负数往前排 */
            order: -1;
            /* 设置该span侧轴的排列 */
            align-self: flex-end;

        }
    </style>

</head>

<body>
    <div><span>one</span>
        <span>two</span>
        <span> </span>
    </div>


</body>
posted @ 2021-06-27 09:33  贾正直  阅读(141)  评论(0)    收藏  举报