首页 >web前端 >css教程 >css3多列及瀑布流效果示例代码

css3多列及瀑布流效果示例代码

高洛峰
高洛峰原创
2017-03-09 18:37:511275浏览

这篇文章介绍css3多列及瀑布流效果示例代码

css3内容分块,多列效果(类似报纸版块排版):

.p02{    /*count:内容分为几列,gap:内容与分割线的距离,rule:分割线样式*/
    column-count:4;
    column-gap:30px;
    column-rule:5px outset #ff0000;
    -webkit-column-count: 4;
    -webkit-column-gap: 30px;
    -webkit-column-rule: 5px outset #ff0000;
}

css3实现图片瀑布流排版:

.container {
    column-width: 350px;
    -webkit-column-width: 350px;
    column-gap: 5px;
    -webkit-column-gap: 5px;
}img {
    width: 400px;
}.container p {
    width: 350px;
    margin: 5px;
}p {
    text-align: center;
}

瀑布流效果html代码如下:

<!DOCTYPE html><html>
    <head>
        <meta charset="UTF-8">
        <title></title>
        <link rel="stylesheet" type="text/css" href="pubuliu.css" />
    </head>
    <body>
        <p class="container">
            <p><img src="../../image/5.jpg" /></p>
            <p><img src="../../image/2.jpg" /><p>文字描述</p></p>
            <p><img src="../../image/5.jpg" /></p>
            <p><img src="../../image/2.jpg" /></p>
            <p><img src="../../image/5.jpg" /><p>文字描述</p></p>
            <p><img src="../../image/3.jpg" /></p>
            <p><img src="../../image/5.jpg" /></p>
            <p><img src="../../image/5.jpg" /></p>
            <p><img src="../../image/3.jpg" /></p>
            <p><img src="../../image/5.jpg" /></p>
            <p><img src="../../image/5.jpg" /><p>文字描述</p></p>
            <p><img src="../../image/5.jpg" /></p>
            <p><img src="../../image/5.jpg" /></p>
            <p><img src="../../image/5.jpg" /></p>
            <p><img src="../../image/5.jpg" /><p>文字描述</p></p>
            <p><img src="../../image/5.jpg" /></p>
            <p><img src="../../image/5.jpg" /></p>
        </p>
    </body></html>

 

以上是css3多列及瀑布流效果示例代码的详细内容。更多信息请关注PHP中文网其他相关文章!

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn