纯css实现瀑布流
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了纯css实现瀑布流,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含1606字,纯文字阅读大概需要3分钟。
内容图文
原文:https://www.jq22.com/webqd6733
<div class="container">
<div class="box">
<img src="http://www.jq22.com/img/cs/500x500-1.png" alt="">
<h2>你好啊!1</h2>
<p>hahahahah</p>
</div>
<div class="box">
<img src="http://www.jq22.com/img/cs/500x300-1.png" alt="">
<h2>你好啊!6</h2>
<p>hahahahah</p>
</div>
<div class="box">
<img src="http://www.jq22.com/img/cs/300x500-1.png" alt="">
<h2>你好啊!2</h2>
<p>hahahahah</p>
</div>
<div class="box">
<img src="http://www.jq22.com/img/cs/500x500-1.png" alt="">
<h2>你好啊!1</h2>
<p>hahahahah</p>
</div>
<div class="box">
<img src="http://www.jq22.com/img/cs/500x300-1.png" alt="">
<h2>你好啊!6</h2>
<p>hahahahah</p>
</div>
<div class="box">
<img src="http://www.jq22.com/img/cs/300x500-1.png" alt="">
<h2>你好啊!2</h2>
<p>hahahahah</p>
</div>
<div class="box">
<img src="http://www.jq22.com/img/cs/500x500-1.png" alt="">
<h2>你好啊!1</h2>
<p>hahahahah</p>
</div>
<div class="box">
<img src="http://www.jq22.com/img/cs/500x300-1.png" alt="">
<h2>你好啊!6</h2>
<p>hahahahah</p>
</div>
<div class="box">
<img src="http://www.jq22.com/img/cs/300x500-1.png" alt="">
<h2>你好啊!2</h2>
<p>hahahahah</p>
</div>
</div>
.body {
margin:0;
padding:0;
background:#333;
}
.container {
width:1200px;
margin:20px auto;
columns:4;
column-gap:40px;
}
.container .box {
width:100%;
margin:0 0 20px;
padding:10px;
background:#fff;
overflow:hidden;
break-inside:avoid;
}
.container .box img {
max-width:100%;
}
@media(max-width:1200px) {
.container {
columns:3;
width:calc(100% - 40px);
box-sizing:border-box;
padding:20px 20px 20px 0;
}
}@media(max-width:768px) {
.container {
columns:2;
}
}@media(max-width:480px) {
.container {
columns:1;
}
}
内容总结
以上是互联网集市为您收集整理的纯css实现瀑布流全部内容,希望文章能够帮你解决纯css实现瀑布流所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。