-
Notifications
You must be signed in to change notification settings - Fork 0
/
waterfalls-flow.html
115 lines (98 loc) · 2.04 KB
/
waterfalls-flow.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>瀑布流</title>
<style>
body {
padding: 0;
margin: 0;
}
/* flex */
/* .waterfall {
padding: 0;
margin: 0;
display: flex;
flex-flow: column wrap;
}
.waterfall li {
width: 50%;
height: 60px;
display: inline-block;
background-color: rosybrown;
}
.waterfall li:nth-child(odd) {
width: 50%;
height: 30px;
background-color: salmon;
} */
/* grad */
/* .waterfall {
padding: 0;
margin: 0;
display: grid;
grid-template-columns: repeat(auto-fill, minmax(133px, 1fr));
grid-gap: 0.25em;
grid-auto-flow: row dense;
grid-auto-rows: 20px;
}
.waterfall li {
box-sizing: border-box;
list-style: none;
}
.waterfall li:nth-of-type(3n+1) {
grid-row: auto / span 5;
background-color: salmon;
}
.waterfall li:nth-of-type(3n+2) {
grid-row: auto / span 6;
background-color: sandybrown;
}
.waterfall li:nth-of-type(3n+3) {
grid-row: auto / span 8;
background-color: skyblue;
} */
/* css3 column */
.waterfall {
padding: 0;
margin: 0;
columns: 50px 2;
-moz-columns: 50px 2;
/* Firefox */
-webkit-columns: 50px 2;
/* Safari 和 Chrome */
column-gap: 10px;
}
.waterfall li {
box-sizing: border-box;
list-style: none;
width: 50vw;
}
.waterfall li:nth-of-type(3n+1) {
background-color: salmon;
height: 155px;
}
.waterfall li:nth-of-type(3n+2) {
background-color: sandybrown;
height: 180px;
}
.waterfall li:nth-of-type(3n+3) {
background-color: skyblue;
height: 168px;
}
</style>
</head>
<body>
<ul class="waterfall">
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
</body>
</html>