forked from Eugene-Kwaka/BOOTSTRAP-5
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgrid-layout1.html
89 lines (80 loc) · 3.21 KB
/
grid-layout1.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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=\, initial-scale=1.0">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<title>BOOTSTRAP GRID-LAYOUT</title>
</head>
<body>
<div class="container my-5">
<h2>Basic Grid</h2>
<div class="row">
<!-- col class will place the elements into columns within the row -->
<div class="col">
<div class="p-5 bg-primary text-light">col 1</div>
</div>
<div class="col">
<div class="p-5 bg-secondary text-light">col 2</div>
</div>
<div class="col">
<div class="p-5 bg-success text-light">col 3</div>
</div>
</div>
</div>
<hr>
<div class="container my-5">
<!-- specifying column widths individually -->
<h2>Column Widths</h2>
<div class="row">
<div class="col-6">
<div class="p-5 bg-primary text-light">col 1</div>
</div>
<div class="col-4">
<div class="p-5 bg-secondary text-light">col 2</div>
</div>
<div class="col-2">
<div class="p-5 bg-success text-light">col 3</div>
</div>
</div>
</div>
<hr>
<div class="container my-5">
<!-- Changing column widths when screen-size differs -->
<h2>Responsive Column-widths</h2>
<div class="row">
<div class="col-sm-4 col-md-6 col-lg-6">
<div class="p-5 bg-primary text-light">col 1</div>
</div>
<div class="col-sm-4 col-md-3 col-lg-3">
<div class="p-5 bg-secondary text-light">col 2</div>
</div>
<div class="col-sm-4 col-md-3 col-lg-3">
<div class="p-5 bg-success text-light">col 3</div>
</div>
</div>
</div>
<hr>
<div class="container my-5">
<h2>Justifying widths</h2>
<!-- justify-content-center will place the items in the row at the center
justify-content-between will create a large space between the items in the row
justify-content-start will place the items at the right end of the page
justify-content-end will place the items at the left end of the page
-->
<div class="row justify-content-center">
<div class="col-md-3">
<div class="p-5 bg-danger text-light">col 1</div>
</div>
<div class="col-md-3">
<div class="p-5 bg-danger text-light">col 2</div>
</div>
<div class="col-md-3">
<div class="p-5 bg-danger text-light">col 3</div>
</div>
</div>
</div>
</body>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
</html>