瀑布流
Posted carlyin
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了瀑布流相关的知识,希望对你有一定的参考价值。
就是利用css3中的column-width规定列的宽度
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>瀑布流</title> <style> .container { column-width: 160px; column-gap: 5px; } .waterfall { border-radius: 5px; background: #D9D9D9; border: #CCC 1px solid; display: inline-block; width: 100%; margin-top: 5px; height: 200px; } .spe { border-radius: 5px; background: #D9D9D9; border: #CCC 1px solid; display: inline-block; width: 100%; margin-top: 5px; height: 66px; } </style> </head> <body> <div class="container"> <div class="waterfall"></div> <div class="waterfall"></div> <div class="spe"></div> <div class="waterfall"></div> <div class="waterfall"></div> <div class="spe"></div> <div class="waterfall"></div> <div class="waterfall"></div> <div class="spe"></div> <div class="waterfall"></div> <div class="spe"></div> <div class="waterfall"></div> <div class="waterfall"></div> <div class="spe"></div> <div class="waterfall"></div> <div class="waterfall"></div> <div class="waterfall"></div> <div class="spe"></div> <div class="waterfall"></div> <div class="waterfall"></div> <div class="waterfall"></div> <div class="spe"></div> <div class="waterfall"></div> <div class="waterfall"></div> <div class="waterfall"></div> <div class="spe"></div> <div class="waterfall"></div> <div class="waterfall"></div> <div class="waterfall"></div> <div class="waterfall"></div> <div class="waterfall"></div> <div class="spe"></div> <div class="waterfall"></div> <div class="waterfall"></div> </div> </body> </html>
以上是关于瀑布流的主要内容,如果未能解决你的问题,请参考以下文章
真的!!!两行css代码实现瀑布流,html,css最简单的瀑布流实现方式且没有缺点!