只用css实现瀑布流效果

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
    <style type="text/css">
        .a{
            width:98%;
            column-count:2;
            column-gap: 10px;
            margin: 0 auto;
            border: 1px solid red;
        }
        .a div{
            margin: 10px;
        }
    </style>
</head>
<body>
    <div class="a">
        <div style="height: 100px;background-color: red;"></div>
        <div style="height: 300px;background-color: yellow;"></div>
        <div style="height: 500px;background-color: gray;"></div>
        <div style="height: 200px;background-color: cyan;"></div>
        <div style="height: 400px;background-color: orange;"></div>
        <div style="height: 50px;background-color: pink;"></div>
    </div>
</body>
</html>

猜你喜欢

转载自blog.csdn.net/zhou_w_x/article/details/84064185