This article mainly introduces the use of CSS3 to achieve waterfall Flow layout example code, small series feel very good, now share to everyone, but also for everyone to do a reference. Let's take a look at it with a little knitting.
Before using the waterfall flow to use JS, now with the CSS3, can be easily implemented.
Master points:
1. Column-count How many columns the text in P is divided into
2, column-width specified column width
3, column-gap specified column clearance
4, Break-inside:avoid; Avoid line breaks within elements and create new columns
Note: Internet Explorer 9 and earlier versions of IE browsers do not support the Column-count property.
The Column-count attribute specifies the number of columns that the element should be delimited:
P{-moz-column-count:3; /* Firefox */-webkit-column-count:3; /* Safari and Chrome */column-count:3;}
The Column-gap property specifies the interval between columns:
p{-moz-column-gap:40px; /* Firefox */-webkit-column-gap:40px; /* Safari and Chrome */column-gap:40px;}
The Column-rule property sets the width, style, and color rules between columns:
p{-moz-column-rule:3px outset #ff0000;/* Firefox */-webkit-column-rule:3px outset #ff0000;/* Safari and Chrome */column- rule:3px outset #ff0000;}
Instance:
<! DOCTYPE html>
The above is the whole content of this article, I hope that everyone's learning has helped, more relevant content please pay attention to topic.alibabacloud.com!