-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpract grid.html
More file actions
55 lines (48 loc) · 1.06 KB
/
pract grid.html
File metadata and controls
55 lines (48 loc) · 1.06 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Subgrid Example</title>
<style>
.parent {
border:1px solid black;
display: grid;
grid-template-columns: 1fr 1fr 1fr;
grid-template-rows: 1fr ;
gap: 10px;
background: #ddd;
padding: 10px;
}
.box {border:1px solid black;
background: lightblue;
padding: 20px;
text-align: center;
}
.child {
display: grid;
grid-template-columns:;
grid-column: 2/ -1; /* Span full width of parent */
gap: 10px;
background: lightcoral;
padding: 10px;
}
.sub-box {
background: white;
padding: 15px;
text-align: center;
border: 1px solid #999;
}
</style>
</head>
<body>
<div class="parent">
<div class="box" style="height:100px":>Box 1</div>
<div class="box">Box 2</div>
<div class="box">Box 3</div>
<div class="child">
<div class="sub-box">Sub 1</div>
<div class="sub-box">Sub 2</div>
</div>
</div>
</body>
</html>