弹性盒子属性的部分演示

弹性盒子

.flex {
            display: flex;
            height: 500px;
            width: 80%;
            margin: 0 auto;
            /* 设置排版的方式 默认为row */
            /* column为竖版 需要给子元素设置高度 */
            flex-direction: column;
            /* 本次设置为默认值 仅供参考 设置属性为grow shrink basis */
            flex: 0 1 auto;
            /*  复合属性  设置属性为direction warp*/
            /* felx-dirction:为排序方式  */
            /* felx-warp:为多行显示  */
            flex-flow: row wrap;
            /* 水平对齐 justify-content */
            justify-content: center;
            /*垂直对齐 align-items*/
            align-items: center;
        }

        .f {
            width: 300px;
            height: 200px;
        }

        .f1 {
            background-color: aqua;
            /* 放大缩小尽量只开启一个 */
            /* 放大属性 */
            /*flex-grow: 0;*/
            /* 缩小属性  控制页面的宽度来展示效果*/
            /*flex-shrink: 10;*/
            /* 在子元素中使用复合属性 */


        }

        .f2 {
            background-color: burlywood;
        }


        .f3 {
            background-color: darkgoldenrod;
        }
 <div class="flex">
        <div class="f f1"></div>
        <div class="f f2"></div>
        <div class="f f3"></div>
    </div>

查看全部属性

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值