-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBootstrapGrid.html
More file actions
116 lines (111 loc) · 3.58 KB
/
BootstrapGrid.html
File metadata and controls
116 lines (111 loc) · 3.58 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
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
116
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Bootstrap 5 Grid Example (Nested)</title>
<link
href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css"
rel="stylesheet"
/>
</head>
<body>
<div class="container">
<!-- Row with 3 equal-width columns -->
<div class="row">
<div class="col">
<div class="p-3 border bg-light">Column 1</div>
</div>
<div class="col">
<div class="p-3 border bg-light">Column 2</div>
</div>
<div class="col">
<div class="p-3 border bg-light">Column 3</div>
</div>
</div>
<!-- Row with 2 columns: 8 units and 4 units -->
<div class="row mt-3">
<div class="col-8">
<div class="p-3 border bg-light">Column 1 (8 units wide)</div>
</div>
<div class="col-4">
<div class="p-3 border bg-light">Column 2 (4 units wide)</div>
</div>
</div>
<!-- Responsive example: columns on smaller screens stack vertically -->
<div class="row mt-3">
<div class="col-md-6 col-sm-12">
<div class="p-3 border bg-light">
Column 1 (6 units on medium, full width on small)
</div>
</div>
<div class="col-md-6 col-sm-12">
<div class="p-3 border bg-light">
Column 2 (6 units on medium, full width on small)
</div>
</div>
</div>
<!-- Nested Columns Example -->
<div class="row mt-3">
<div class="col-6">
<div class="p-3 border bg-light">
Parent Column 1 (6 units wide)
<div class="row mt-3">
<div class="col-6">
<div class="p-3 border bg-secondary">
Nested Column 1 (6 units of 6)
</div>
</div>
<div class="col-6">
<div class="p-3 border bg-secondary">
Nested Column 2 (6 units of 6)
</div>
</div>
</div>
</div>
</div>
<div class="col-6">
<div class="p-3 border bg-light">
Parent Column 2 (6 units wide)
<div class="row mt-3">
<div class="col-4">
<div class="p-3 border bg-secondary">
Nested Column 1 (4 units of 6)
</div>
</div>
<div class="col-8">
<div class="p-3 border bg-secondary">
Nested Column 2 (8 units of 6)
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Complex column layout -->
<div class="row mt-3">
<div class="col-4">
<div class="p-3 border bg-light">Column 1 (4 units wide)</div>
</div>
<div class="col-8">
<div class="p-3 border bg-light">
Column 2 (8 units wide)
<div class="row mt-3">
<div class="col-3">
<div class="p-3 border bg-secondary">
Nested Column 1 (3 units of 8)
</div>
</div>
<div class="col-9">
<div class="p-3 border bg-secondary">
Nested Column 2 (9 units of 8)
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>