多个div分成两列瀑布流展示

在这里插入图片描述

效果是为了有这么块 两列 瀑布流布局
css
multi-column实现 瀑布流主要依赖以下几个属性:
column-count: 设置共有几列
column-width: 设置每列宽度,列数由 总宽度与 每列宽度计算得出
column-gap: 设置列与列之间的间距

break-inside: auto | avoid
auto: 元素可以中断
avoid: 元素不能中断
在这里插入图片描述

<div style="width: 1000px;background-color: antiquewhite;column-count:2">
        <div style="break-inside:avoid;background-color: aqua; height: 20px;"></div>
        <div style="break-inside:avoid;background-color: rgb(0, 123, 255); height: 80px;"></div>
        <div style="break-inside:avoid;background-color: rgb(102, 255, 0); height: 40px;"></div>
        <div style="break-inside:avoid;background-color: rgb(255, 0, 123); height: 50px;"></div>
        <div style="break-inside:avoid;background-color: rgb(255, 47, 0); height: 60px;"></div>
        <div style="break-inside:avoid;background-color: rgb(191, 255, 0); height: 70px;"></div>
        <div style="break-inside:avoid;background-color: rgb(136, 0, 255); height: 80px;"></div>
        <div style="break-inside:avoid;background-color: rgb(255, 208, 0); height: 90px;"></div>
        <div style="break-inside:avoid;background-color: rgb(255, 98, 0); height: 100px;"></div>
        <div style="break-inside:avoid;background-color: rgb(179, 0, 255); height: 90px;"></div>
        <div style="break-inside:avoid;background-color: rgb(255, 0, 149); height: 80px;"></div>
    </div>
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值