多列布局案例-流体布局

本文通过CSS3技术详细讲解如何创建一个多列流体布局,利用断层效果达到理想的展示效果,适用于响应式网页设计。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

运用多列布局做出的效果

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
        <style>
            *{margin: 0;padding: 0;}
            body{
                padding:0px 10px;
                background:url(img/bg.gif),url(img/a.png) #3A434C;
                background-size:30% 30%;
            }
            section{
                column-count:5;/*分了5*/
                column-gap:0px;/*消除列间隔*/
            }
            figure{
                border:2px solid pink;
                break-inside: avoid;/*防止断层*/
                padding:5px;
                margin:0px 5px 10px;
                text-align:center;
                color:pink;
                font-size:20px;
            }
            img{width:100%;}
             
        </style>
    </head>
    <body>
		<audio src="audio/zhoujie.mp3" autoplay></audio>
        <section>
            <figure>
                <img src="./img/1.jpg" alt="" />
                <figcaption>往后余生,平淡是你</figcaption>
            </figure>
            <figure>
                <img src="img/2.jpg" alt="" />
                <figcaption>往后余生,平淡是你</figcaption>
            </figure>
            <figure>
                <img src="img/3.jpg" alt="" />
                <figcaption>往后余生,平淡是你</figcaption>
            </figure>
            <figure>
                <img src="img/4.jpg" alt="" />
                <figcaption>往后余生,平淡是你</figcaption>
            </figure>
            <figure>
                <img src="img/5.jpg" alt="" />
                <figcaption>往后余生,平淡是你</figcaption>
            </figure>
            <figure>
                <img src="img/6.jpg" alt="" />
                <figcaption>往后余生,平淡是你</figcaption>
            </figure>
            <figure>
                <img src="img/7.jpg" alt="" />
                <figcaption>往后余生,平淡是你</figcaption>
            </figure>
            <figure>
                <img src="img/8.jpg" alt="" />
                <figcaption>往后余生,平淡是你</figcaption>
            </figure>
            <figure>
                <img src="img/9.jpg" alt="" />
                <figcaption>往后余生,平淡是你</figcaption>
            </figure>
            <figure>
                <img src="img/50.jpg" alt="" />
                <figcaption>往后余生,平淡是你</figcaption>
            </figure>
           
			    <img src="img/50.jpg" alt="" />
			    <figcaption>往后余生,平淡是你</figcaption>
			</figure>
        </section>
    </body>
</html>

这里会用到断层的效果,实现效果图如下
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值