-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnested-grid.html
57 lines (57 loc) · 1.33 KB
/
nested-grid.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Grid Lines</title>
<style>
body {
text-align: center;
color: #fff;
}
#content {
display: grid;
grid-template-columns: repeat(3, 1fr);
margin: 0 auto;
grid-gap: 10px;
max-width: 960px;
}
#content div {
background: green;
padding: 30px;
}
#content div:nth-child(even){
background: black;
}
.nested {
display: grid;
grid-template-columns: 1fr 1fr;
grid-gap: 10px;
/* start from 1 and end at line 4 */
/* grid-column: 1/4; */
/*same as above property start default and take upto 4*/
grid-column: span 3;
}
p {
border: 1px solid #fff;
margin: 0;
padding: 20px;
}
</style>
</head>
<body>
<div id="content">
<div>1</div>
<div>2</div>
<div>3</div>
<div class="nested">
<p>1</p>
<p>2</p>
<p>3</p>
<p>4</p>
</div>
<div>5</div>
<div>6</div>
</div>
</body>
</html>