-
Notifications
You must be signed in to change notification settings - Fork 0
/
2.html
54 lines (50 loc) · 1.64 KB
/
2.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Responsiveness with css grid</title>
<style>
/* basic stying */
.item {
padding: 10px;
background: #333;
color: white;
}
/* actual styling */
.container {
display: grid;
grid-gap: 3px; /* replaces the margin from basic styling */
grid-template-rows: 80px 80px 80px 80px;
grid-template-columns: 33.33% 33.33% 33.33%;
/* grid-template-rows: repeat(4, 80px); */
/* grid-template: repeat(4, 80px) / repeat(3, 1fr); */
/* grid-auto-rows: 80px;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); */
}
</style>
</head>
<body>
<div class="container">
<div class="item">Child element 1</div>
<div class="item">Child element 2</div>
<div class="item">Child element 3</div>
<div class="item">Child element 4</div>
<div class="item">Child element 5</div>
<div class="item">Child element 6</div>
<div class="item">Child element 7</div>
<div class="item">Child element 8</div>
<div class="item">Child element 9</div>
<div class="item">Child element 10</div>
<div class="item">Child element 11</div>
<div class="item">Child element 12</div>
<div class="item">Child element 10</div>
<div class="item">Child element 11</div>
<div class="item">Child element 12</div>
<div class="item">Child element 10</div>
<div class="item">Child element 11</div>
<div class="item">Child element 12</div>
</div>
</body>
</html>