-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathauto-fill-fit.html
60 lines (51 loc) · 1.27 KB
/
auto-fill-fit.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<link rel="stylesheet" href="style.css">
<body>
<div class="header">Auto fill sample</div>
<div class="container">
<div class="item">1</div>
<div class="item">2</div>
<div class="item">3</div>
<div class="item">4</div>
<div class="item">5</div>
<div class="item">6</div>
<div class="item">7</div>
<div class="item">8</div>
<div class="item">9</div>
</div>
<div class="header">Auto fill last elem</div>
<div class="container">
<div class="item">1</div>
<div class="item">2</div>
<div class="item">3</div>
<div class="item">4</div>
<div class="item item5">5</div>
</div>
<div class="header">Auto fit minmax - responsive</div>
<div class="containerResponsive">
<div class="item">1</div>
<div class="item">2</div>
<div class="item">3</div>
<div class="item">4</div>
</div>
</body>
<style>
.container {
display: grid;
grid-template-columns: repeat(auto-fill, 150px);
grid-gap: 25px;
}
.containerResponsive {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
grid-gap: 25px;
}
.item5 {
grid-column-end: -1;
}
</style>
</html>