css3多列及瀑布流效果

2018-06-24 01:04:28来源:未知 阅读 ()

新老客户大回馈,云服务器低至5折

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

.div02{
    /*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 div {
    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>
        <div class="container">
            <div><img src="../../image/5.jpg" /></div>
            <div><img src="../../image/2.jpg" /><p>文字描述</p></div>
            <div><img src="../../image/5.jpg" /></div>
            <div><img src="../../image/2.jpg" /></div>
            <div><img src="../../image/5.jpg" /><p>文字描述</p></div>
            <div><img src="../../image/3.jpg" /></div>
            <div><img src="../../image/5.jpg" /></div>
            <div><img src="../../image/5.jpg" /></div>
            <div><img src="../../image/3.jpg" /></div>
            <div><img src="../../image/5.jpg" /></div>
            <div><img src="../../image/5.jpg" /><p>文字描述</p></div>
            <div><img src="../../image/5.jpg" /></div>
            <div><img src="../../image/5.jpg" /></div>
            <div><img src="../../image/5.jpg" /></div>
            <div><img src="../../image/5.jpg" /><p>文字描述</p></div>
            <div><img src="../../image/5.jpg" /></div>
            <div><img src="../../image/5.jpg" /></div>
        </div>
    </body>
</html>

 

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:关于table的td和ul元素li隔行变色的功能实现

下一篇:css常用样式