Home  >  Article  >  Web Front-end  >  CSS3 method to implement waterfall flow layout

CSS3 method to implement waterfall flow layout

php中世界最好的语言
php中世界最好的语言Original
2018-03-21 10:01:572786browse

This time I will bring you How to implement waterfall flow layout with CSS3, what are the notes for CSS3 to implement waterfall flow layout, the following is a practical case, let’s take a look.

In the past, js was required to use waterfall flow. Now with css3, it can be easily implemented.

Mastery points:

1. column-count divides the text in p into several columns

2. column-width specifies the column width

3. column-gap specifies the column gap

4. break-inside: avoid; avoids breaking lines inside elements and generating new columns

Note: Internet Explorer 9 and earlier IE The version browser does not support the column-count attribute.

column-count attribute specifies the number of columns by which elements should be separated:

p
{
-moz-column-count:3;  /* Firefox */
-webkit-column-count:3; /* Safari 和 Chrome */
column-count:3;
}

column-gap attribute specifies the gap between columns:

p
{
-moz-column-gap:40px;  /* Firefox */
-webkit-column-gap:40px; /* Safari 和 Chrome */
column-gap:40px;
}

column-rule attribute sets the column Width, style and color rules between:

p
{
-moz-column-rule:3px outset #ff0000; /* Firefox */
-webkit-column-rule:3px outset #ff0000; /* Safari and Chrome */
column-rule:3px outset #ff0000;
}

Example:




    
    CSS3瀑布流
    

    

        

            

                                 

1 convallis timestamp

           

            

                                 

2 convallis timestamp 2 Donec a fermentum nisi. 

           

            

                                 

3 Nullam eget lectus augue. Donec eu sem sit amet ligula          faucibus suscipit. Suspendisse rutrum turpis quis nunc          convallis quis aliquam mauris suscipit.

           

            

                                 

 4 Donec a fermentum nisi. Integer dolor est, commodo ut          sagittis vitae, egestas at augue. 

           

  

                                 

 5 Donec a fermentum nisi. Integer dolor est, commodo ut sagittis vitae, egestas at augue.

           

        

    

I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related articles on the PHP Chinese website!

Recommended reading:

CSS3 to create a large striped background

css3 text gradient animation

CSS3 dynamic prompt effect when the mouse moves into the picture

The above is the detailed content of CSS3 method to implement waterfall flow layout. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn