css做多列瀑布流
阿新 • • 發佈:2021-08-22
<!DOCTYPEhtml>
<htmllang="en">
<head>
<metacharset="UTF-8">
<metaname="viewport"content="width=device-width,initial-scale=1.0">
<title>Document</title>
<style>
*{
margin:0;
padding:0;
box-sizing:border-box;
}
section{
width:100%;
background:#4d3821;
/*列數*/
column-count:5;
/*清除列間隔*/
column-gap:8px;
}
figure{
width:100%;
border:4pxsolidpink;
padding:8px;
/*防止斷裂*/
break-inside:avoid;
margin-bottom:8px;
}
figureimg{
display:block;
width:100%;
/*圖片高度不能設定,等比縮放*/
}
figcaption{
text-align:center;
line-height:40px;
font-size:20px;
color:pink;
font-weight:900;
}
</style>
</head>
<body>
<section>
<figure>
<imgsrc="./img/1.jpg"alt="">
<figcaption>窈窕淑女,君子好逑</figcaption>
</figure>
<figure>
<imgsrc="./img/2.jpg"alt="">
<figcaption>窈窕淑女,君子好逑</figcaption>
</figure>
<figure>
<imgsrc="./img/3.jpg"alt="">
<figcaption>窈窕淑女,君子好逑</figcaption>
</figure>
<figure>
<imgsrc="./img/4.jpg"alt="">
<figcaption>窈窕淑女,君子好逑</figcaption>
</figure>
<figure>
<imgsrc="./img/5.jpg"alt="">
<figcaption>窈窕淑女,君子好逑</figcaption>
</figure>
<figure>
<imgsrc="./img/6.jpg"alt="">
<figcaption>窈窕淑女,君子好逑</figcaption>
</figure>
<figure>
<imgsrc="./img/7.jpg"alt="">
<figcaption>窈窕淑女,君子好逑</figcaption>
</figure>
<figure>
<imgsrc="./img/8.jpg"alt="">
<figcaption>窈窕淑女,君子好逑</figcaption>
</figure>
<figure>
<imgsrc="./img/9.jpg"alt="">
<figcaption>窈窕淑女,君子好逑</figcaption>
</figure>
<figure>
<imgsrc="./img/10.jpg"alt="">
<figcaption>窈窕淑女,君子好逑</figcaption>
</figure>
<figure>
<imgsrc="./img/1.jpg"alt="">
<figcaption>窈窕淑女,君子好逑</figcaption>
</figure>
<figure>
<imgsrc="./img/2.jpg"alt="">
<figcaption>窈窕淑女,君子好逑</figcaption>
</figure>
<figure>
<imgsrc="./img/3.jpg"alt="">
<figcaption>窈窕淑女,君子好逑</figcaption>
</figure>
<figure>
<imgsrc="./img/4.jpg"alt="">
<figcaption>窈窕淑女,君子好逑</figcaption>
</figure>
<figure>
<imgsrc="./img/5.jpg"alt="">
<figcaption>窈窕淑女,君子好逑</figcaption>
</figure>
<figure>
<imgsrc="./img/6.jpg"alt="">
<figcaption>窈窕淑女,君子好逑</figcaption>
</figure>
<figure>
<imgsrc="./img/7.jpg"alt="">
<figcaption>窈窕淑女,君子好逑</figcaption>
</figure>
<figure>
<imgsrc="./img/8.jpg"alt="">
<figcaption>窈窕淑女,君子好逑</figcaption>
</figure>
<figure>
<imgsrc="./img/9.jpg"alt="">
<figcaption>窈窕淑女,君子好逑</figcaption>
</figure>
<figure>
<imgsrc="./img/10.jpg"alt="">
<figcaption>窈窕淑女,君子好逑</figcaption>
</figure>
<figure>
<imgsrc="./img/1.jpg"alt="">
<figcaption>窈窕淑女,君子好逑</figcaption>
</figure>
<figure>
<imgsrc="./img/2.jpg"alt="">
<figcaption>窈窕淑女,君子好逑</figcaption>
</figure>
<figure>
<imgsrc="./img/3.jpg"alt="">
<figcaption>窈窕淑女,君子好逑</figcaption>
</figure>
<figure>
<imgsrc="./img/4.jpg"alt="">
<figcaption>窈窕淑女,君子好逑</figcaption>
</figure>
<figure>
<imgsrc="./img/5.jpg"alt="">
<figcaption>窈窕淑女,君子好逑</figcaption>
</figure>
<figure>
<imgsrc="./img/6.jpg"alt="">
<figcaption>窈窕淑女,君子好逑</figcaption>
</figure>
<figure>
<imgsrc="./img/7.jpg"alt="">
<figcaption>窈窕淑女,君子好逑</figcaption>
</figure>
<figure>
<imgsrc="./img/8.jpg"alt="">
<figcaption>窈窕淑女,君子好逑</figcaption>
</figure>
<figure>
<imgsrc="./img/9.jpg"alt="">
<figcaption>窈窕淑女,君子好逑</figcaption>
</figure>
<figure>
<imgsrc="./img/10.jpg"alt="">
<figcaption>窈窕淑女,君子好逑</figcaption>
</figure>
<figure>
<imgsrc="./img/1.jpg"alt="">
<figcaption>窈窕淑女,君子好逑</figcaption>
</figure>
<figure>
<imgsrc="./img/2.jpg"alt="">
<figcaption>窈窕淑女,君子好逑</figcaption>
</figure>
<figure>
<imgsrc="./img/3.jpg"alt="">
<figcaption>窈窕淑女,君子好逑</figcaption>
</figure>
<figure>
<imgsrc="./img/4.jpg"alt="">
<figcaption>窈窕淑女,君子好逑</figcaption>
</figure>
<figure>
<imgsrc="./img/5.jpg"alt="">
<figcaption>窈窕淑女,君子好逑</figcaption>
</figure>
<figure>
<imgsrc="./img/6.jpg"alt="">
<figcaption>窈窕淑女,君子好逑</figcaption>
</figure>
<figure>
<imgsrc="./img/7.jpg"alt="">
<figcaption>窈窕淑女,君子好逑</figcaption>
</figure>
<figure>
<imgsrc="./img/8.jpg"alt="">
<figcaption>窈窕淑女,君子好逑</figcaption>
</figure>
<figure>
<imgsrc="./img/9.jpg"alt="">
<figcaption>窈窕淑女,君子好逑</figcaption>
</figure>
<figure>
<imgsrc="./img/10.jpg"alt="">
<figcaption>窈窕淑女,君子好逑</figcaption>
</figure>
<figure>
<imgsrc="./img/1.jpg"alt="">
<figcaption>窈窕淑女,君子好逑</figcaption>
</figure>
<figure>
<imgsrc="./img/2.jpg"alt="">
<figcaption>窈窕淑女,君子好逑</figcaption>
</figure>
<figure>
<imgsrc="./img/3.jpg"alt="">
<figcaption>窈窕淑女,君子好逑</figcaption>
</figure>
<figure>
<imgsrc="./img/4.jpg"alt="">
<figcaption>窈窕淑女,君子好逑</figcaption>
</figure>
<figure>
<imgsrc="./img/5.jpg"alt="">
<figcaption>窈窕淑女,君子好逑</figcaption>
</figure>
<figure>
<imgsrc="./img/6.jpg"alt="">
<figcaption>窈窕淑女,君子好逑</figcaption>
</figure>
<figure>
<imgsrc="./img/7.jpg"alt="">
<figcaption>窈窕淑女,君子好逑</figcaption>
</figure>
<figure>
<imgsrc="./img/8.jpg"alt="">
<figcaption>窈窕淑女,君子好逑</figcaption>
</figure>
<figure>
<imgsrc="./img/9.jpg"alt="">
<figcaption>窈窕淑女,君子好逑</figcaption>
</figure>
<figure>
<imgsrc="./img/10.jpg"alt="">
<figcaption>窈窕淑女,君子好逑</figcaption>
</figure>
<figure>
<imgsrc="./img/1.jpg"alt="">
<figcaption>窈窕淑女,君子好逑</figcaption>
</figure>
<figure>
<imgsrc="./img/2.jpg"alt="">
<figcaption>窈窕淑女,君子好逑</figcaption>
</figure>
<figure>
<imgsrc="./img/3.jpg"alt="">
<figcaption>窈窕淑女,君子好逑</figcaption>
</figure>
<figure>
<imgsrc="./img/4.jpg"alt="">
<figcaption>窈窕淑女,君子好逑</figcaption>
</figure>
<figure>
<imgsrc="./img/5.jpg"alt="">
<figcaption>窈窕淑女,君子好逑</figcaption>
</figure>
<figure>
<imgsrc="./img/6.jpg"alt="">
<figcaption>窈窕淑女,君子好逑</figcaption>
</figure>
<figure>
<imgsrc="./img/7.jpg"alt="">
<figcaption>窈窕淑女,君子好逑</figcaption>
</figure>
<figure>
<imgsrc="./img/8.jpg"alt="">
<figcaption>窈窕淑女,君子好逑</figcaption>
</figure>
<figure>
<imgsrc="./img/9.jpg"alt="">
<figcaption>窈窕淑女,君子好逑</figcaption>
</figure>
<figure>
<imgsrc="./img/10.jpg"alt="">
<figcaption>窈窕淑女,君子好逑</figcaption>
</figure>
</section>
</body>
</html>
<!--
防止元素斷裂:
break-inside:avoid;
-->
右側打賞一下 程式碼改變世界一塊二塊也是愛