Bootstrap Practical
Bootstrap Practical
Bootstrap-layout
1) Responsive containers
<!DOCTYPE html>
<html>
<head>
<link href="css\bootstrap.css" rel="stylesheet">
</head>
<body>
<div class="container-sm1">
Containers
Containers are a fundamental building block of Bootstrap
that contain, pad, and align your content within a given device
or viewport.
Responsive containers
Responsive containers allow you to specify a class that is
100% wide until the specified breakpoint is reached, after
which we apply max-widths for each of the higher
breakpoints. For example, .container-sm is 100% wide to start
until the sm breakpoint is reached, where it will scale up with
md, lg, xl, and xxl.
</div>
<div class="container-xxl">Containers
Containers are a fundamental building block of Bootstrap
that contain, pad, and align your content within a given device
or viewport.
1
Ch-5 BootstrapFramework _Practical
Responsive containers
Responsive containers allow you to specify a class that is
100% wide until the specified breakpoint is reached, after
which we apply max-widths for each of the higher
breakpoints. For example, .container-sm is 100% wide to start
until the sm breakpoint is reached, where it will scale up with
md, lg, xl, and xxl.
</div>
</body>
</html>
Output
2)row
<!-- Row -->
<!DOCTYPE html>
<html>
<head>
<link href="css\bootstrap.css" rel="stylesheet">
</head>
<body>
<div class="container text-center">
2
Ch-5 BootstrapFramework _Practical
<div class="row">
<div>.col-6 .col-sm-3</div>
<div class="col-6 col-sm-3">.col-6 .col-sm-3</div>
<div class="w-100"></div>
<div class="col-6 col-sm-3">.col-6 .col-sm-3</div>
<div class="col-6 col-sm-3">.col-6 .col-sm-3</div>
</div>
</div>
</body>
</html>
Output
3)Column
<!-- columns -->
<!DOCTYPE html>
<html>
<head>
<link href="css\bootstrap.css" rel="stylesheet">
</head>
3
Ch-5 BootstrapFramework _Practical
<body>
<div>
<div class="row">
<div class="col-md-4">
One of three columns
</div>
<div class="col">
One of three columns
</div>
<div class="col">
One of three columns
</div>
<div class="col">
One of three columns
</div>
</div>
</div>
</body>
</html>
Output
4
Ch-5 BootstrapFramework _Practical
4) Responsive Classes
<!DOCTYPE html>
<html>
<head>
<!-- <link href="css/bootstrap.min.css" rel="stylesheet">
<script src="js/bootstrap.min.js"></script> -->
<link href="css\bootstrap.css" rel="stylesheet">
</head>
<body>
<div class="row">
<div class="col">col</div>
<div class="col">col</div>
<div class="col">col</div>
<div class="col">col</div>
</div>
<div class="row">
<div class="col-2">col-8</div>
<div class="col-4">col-4</div>
</div>
</body>
</html>
5
Ch-5 BootstrapFramework _Practical
Output
5) Re-Ordering
<!DOCTYPE html>
<html>
<head>
<link href="css/bootstrap.css" rel="stylesheet">
<!--<script src="js/bootstrap.min.js"></script>-->
</head>
<body>
<div class="container text-center">
<div class="row">
<div class="col order-5">
1
</div>
<div class="col order-1">
200
</div>
<div class="col order-2">
2
</div>
6
Ch-5 BootstrapFramework _Practical
</div>
</div>
</body>
</html>
Output
6) offset column
<!DOCTYPE html>
<html>
<head>
<link href="css/bootstrap.css" rel="stylesheet">
</head>
<body>
<div class="container text-center">
<div class="row border">
<div class="col-md-4 border">.col-md-4</div>
<div class="col-md-4 offset-md-4 border">.col-md-4
.offset-md-4</div>
</div>
<div class="row">
<div class="col-md-3 offset-md-3">.col-md-3 .offset-md-
3</div>
7
Ch-5 BootstrapFramework _Practical
Content-typography
1) Heading
<!-- Headings -->
<!DOCTYPE html>
<html>
<head>
<link href="css/bootstrap.css" rel="stylesheet">
<!-- <script src="js/bootstrap.min.js"></script>-->
</head>
<body>
<p class="h1"> I'm Heading1</p>
8
Ch-5 BootstrapFramework _Practical
10
Ch-5 BootstrapFramework _Practical
<h2>Lead Example</h2>
<p class = "lead">This is an example paragraph
demonstrating
the use of lead body copy. This is an example paragraph
demonstrating the use of lead body copy.This is an
example
paragraph demonstrating the use of lead body copy.This is
an
example paragraph demonstrating the use of lead body
copy.
This is an example paragraph demonstrating the use of
lead body copy.</p>
</body>
</html>
Output
4)Emphasis
<!DOCTYPE html>
<html>
<head>
<link href="css/bootstrap.css" rel="stylesheet">
</head>
11
Ch-5 BootstrapFramework _Practical
<body>
<small>This content is within tag</small><br>
<strong>This content is within tag</strong><br>
<em>This content is within tag and is rendered as
italics</em><br>
<p class="text-left">Left aligned text.</p>
<p class="text-center">Center aligned text.</p>
<p class="text-right">Right aligned text.</p>
<p class="text-muted">This content is muted</p>
<p class="text-primary">This content carries a primary
class</p>
<p class="text-success">This content carries a success
class</p>
<p class="text-info">This content carries a info class</p>
<p class="text-warning">This content carries a warning
class</p>
<p class="text-danger">This content carries a danger
class</p>
</body>
</html>
Output
12
Ch-5 BootstrapFramework _Practical
5)abbr
<!DOCTYPE html>
<html>
<head>
<link href="css/bootstrap.css" rel="stylesheet">
<!-- <script src="js/bootstrap.min.js"></script> -->
</head>
<body>
<abbr title="World Wide Web"
class="initialism">WWW</abbr><br>
<abbr title="Real Simple Syndication" >RSS</abbr>
</body>
</html>
Output
6) Addresses
<!DOCTYPE html>
<html>
<head>
<link href="css/bootstrap.css" rel="stylesheet">
13
Ch-5 BootstrapFramework _Practical
14
Ch-5 BootstrapFramework _Practical
7) blockquote
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<link href="css/bootstrap.css" rel="stylesheet">
</head>
<body>
<div class="container">
<h1>Blockquotes</h1>
<p>The blockquote element is used to present content from
another source:</p>
<blockquote class="blockquote">
<p>For 50 years, WWF has been protecting the future of
nature. The world's leading conservation organization, WWF
works in 100 countries and is supported by 1.2 million
members in the United States and close to 5 million
globally.</p>
<p class="blockquote-footer">From WWF's website</p>
</blockquote>
</div>
</body>
</html>
15
Ch-5 BootstrapFramework _Practical
Output
Table
1)Basic Table
<!DOCTYPE html>
<html>
<head>
<link href="css/bootstrap.css" rel="stylesheet">
<!-- <script src="js/bootstrap.min.js"></script> -->
</head>
<body>
<table class="table">
<caption>Basic Table Layout</caption>
<thead>
<tr>
<th>Name</th>
<th>City</th>
</tr>
</thead>
<tbody>
<tr>
16
Ch-5 BootstrapFramework _Practical
<td>Tanmay</td>
<td>Bangalore</td>
</tr>
<tr>
<td>Sachin</td>
<td>Mumbai</td>
</tr>
</tbody>
</table>
</body>
</html>
Output
3) Striped Table
<!DOCTYPE html>
<html>
<head>
<link href="css/bootstrap.css" rel="stylesheet">
<!-- <script src="js/bootstrap.min.js"></script> -->
</head>
<body>
17
Ch-5 BootstrapFramework _Practical
<td>411027</td>
</tr>
</tbody>
</table>
</body>
</html>
Output
3) Bordered Table
<!DOCTYPE html>
<html>
<head>
<link href="css/bootstrap.css" rel="stylesheet">
<!-- <script src="js/bootstrap.min.js"></script> -->
</head>
<body>
<table class="table-bordered">
<caption>Bordered Table Layout</caption>
<thead>
<tr>
<th>Name</th>
19
Ch-5 BootstrapFramework _Practical
<th>City</th>
<th>Pincode</th>
</tr>
</thead>
<tbody>
<tr>
<td>Tanmay</td>
<td>Bangalore</td>
<td>560001</td>
</tr>
<tr>
<td>Sachin</td>
<td>Mumbai</td>
<td>400003</td>
</tr>
<tr>
<td>Uma</td>
<td>Pune</td>
<td>411027</td>
</tr>
</tbody>
</table>
</body>
20
Ch-5 BootstrapFramework _Practical
</html>
Output
4) Hover Table
<!DOCTYPE html>
<html>
<head>
<link href="css/bootstrap.css" rel="stylesheet">
<!-- <script src="js/bootstrap.min.js"></script> -->
</head>
<body>
<table class="table table-hover">
<caption>Hover Table Layout</caption>
<thead>
<tr>
<th>Name</th>
<th>City</th>
<th>Pincode</th>
</tr>
21
Ch-5 BootstrapFramework _Practical
</thead>
<tbody>
<tr>
<td>Tanmay</td>
<td>Bangalore</td>
<td>560001</td>
</tr>
<tr>
<td>Sachin</td>
<td>Mumbai</td>
<td>400003</td>
</tr>
<tr>
<td>Uma</td>
<td>Pune</td>
<td>411027</td>
</tr>
</tbody>
</table>
</body>
</html>
Output
22
Ch-5 BootstrapFramework _Practical
5) Contextual Table
<!DOCTYPE html>
<html>
<head>
<link href="css/bootstrap.css" rel="stylesheet">
<!-- <script src="js/bootstrap.min.js"></script>-->
</head>
<body>
<table class="table">
<caption>Contextual Table Layout</caption>
<thead>
<tr>
<th>Product</th>
<th>Payment Date</th>
<th>Status</th>
</tr>
</thead>
<tbody>
<tr class="table-active">
<td>Product1</td>
23
Ch-5 BootstrapFramework _Practical
<td>23/11/2013</td>
<td>Pending</td>
</tr>
<tr class="table-success">
<td>Product2</td>
<td>10/11/2013</td>
<td>Delivered</td>
</tr>
<tr class="table-warning">
<td>Product3</td>
<td>20/10/2013</td>
<td>In Call to confirm</td>
</tr>
<tr class="table-danger">
<td>Product4</td>
<td>20/10/2013</td>
<td>Declined</td>
</tr>
</tbody>
</table>
</body>
</html>
Output
24
Ch-5 BootstrapFramework _Practical
6) Responsive Table
<!DOCTYPE html>
<html>
<head>
<link href="css/bootstrap.css" rel="stylesheet">
<!-- <script src="js/bootstrap.min.js"></script> -->
</head>
<body>
<div class="table-responsive">
<table class="table table-bordered">
<thead>
<tr>
<th>#</th>
<th>Firstname</th>
<th>Lastname</th>
<th>Age</th>
<th>City</th>
<th>Country</th>
<th>Sex</th>
<th>Example</th>
25
Ch-5 BootstrapFramework _Practical
<th>Example</th>
<th>Example</th>
<th>Example</th>
<th>Example</th>
<th>Example</th>
<th>Example</th>
<th>Example</th>
<th>Example</th>
<th>Example</th>
<th>Example</th>
<th>Example</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>Anna</td>
<td>Pitt</td>
<td>35</td>
<td>New York</td>
<td>USA</td>
<td>Female</td>
<td>Yes</td>
26
Ch-5 BootstrapFramework _Practical
<td>Yes</td>
<td>Yes</td>
<td>Yes</td>
<td>Yes</td>
<td>Yes</td>
<td>Yes</td>
<td>Yes</td>
<td>Yes</td>
<td>Yes</td>
<td>Yes</td>
<td>Yes</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>
Output
Image
<!DOCTYPE html>
<html>
27
Ch-5 BootstrapFramework _Practical
<head>
<link href="css/bootstrap.css" rel="stylesheet">
<!-- <script src="js/bootstrap.min.js"></script> -->
</head>
<body>
<img src="2.jpg" class="rounded float-start"><br>
<img src="1.jpg" class="rounded-circle float-end"><br>
<img src="2.jpg" class="img-thumbnail mx-auto d-
block">
</body>
</html>
Output
Form
1) Stacked Form
<!DOCTYPE html>
<html>
<head>
<link href="css/css3/bootstrap.css" rel="stylesheet">
<!-- <script src="js/bootstrap.min.js"></script> -->
28
Ch-5 BootstrapFramework _Practical
</head>
<body>
<div class="container">
<h2>Stacked form</h2>
<form action="/action_page.php">
<div class="form-group">
<label for="email">Email:</label>
<input type="email" class="form-control" id="email"
placeholder="Enter email" name="email">
</div>
<div class="form-group">
<label for="pwd">Password:</label>
<input type="password" class="form-control" id="pwd"
placeholder="Enter password" name="pswd">
</div>
<div >
<label class="form-check-label">
<input class="form-check-input" type="checkbox"
name="remember"> Remember me
</label>
</div>
<button type="submit" class="btn btn-
primary">Submit</button>
</form>
29
Ch-5 BootstrapFramework _Practical
</div>
</body>
</html>
Output
2) Inline Form
<!DOCTYPE html>
<html>
<head>
<link href="css/css3/bootstrap.css" rel="stylesheet">
<!-- <script src="js/bootstrap.min.js"></script> -->
</head>
<body>
<div class="container">
<h2>Inline form</h2>
<p>Make the viewport larger than 576px wide to see that all
of the form elements are inline and left-aligned. On small
screens, the form groups will stack horizontally.</p>
<form class="form-inline">
<label for="email2" >Email:</label>
30
Ch-5 BootstrapFramework _Practical
3) Form inputs
<!DOCTYPE html>
<html>
<head>
31
Ch-5 BootstrapFramework _Practical
32
Ch-5 BootstrapFramework _Practical
<label class="form-check-label">
<input type="checkbox" class="form-check-input"
value="">Option 1
</label>
</div>
<div class="form-check">
<label class="form-check-label">
<input type="checkbox" class="form-check-input"
value="">Option 2
</label>
</div>
<div class="form-check">
<label class="form-check-label">
<input type="checkbox" class="form-check-input"
value="" disabled>Option 3
</label>
</div>
<label for="comment">Redio Button:</label><br>
<div class="form-check-inline">
<label class="form-check-label">
<input type="radio" class="form-check-input"
name="optradio">Option 1
</label>
</div>
33
Ch-5 BootstrapFramework _Practical
<div class="form-check-inline">
<label class="form-check-label">
<input type="radio" class="form-check-input"
name="optradio">Option 2
</label>
</div>
<div class="form-check-inline disabled">
<label class="form-check-label">
<input type="radio" class="form-check-input"
name="optradio" disabled>Option 3
</label>
</div>
<div class="form-group">
<label for="sel1">Select list:</label>
<select class="form-control" id="sel1">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
</select>
</div>
<div class = "form-group">
<h3>Form Control Sizing</h3>
34
Ch-5 BootstrapFramework _Practical
35
Ch-5 BootstrapFramework _Practical
Utilities
1)Color Utilities
<!DOCTYPE html>
<html>
<head>
<!-- <link href="css/css3/bootstrap.css" rel="stylesheet"> -->
<link href="css/bootstrap.css" rel="stylesheet">
</head>
<body>
<p class="text-primary">R.P.Bhalodiy</p>
<p class="text-secondary">.text-secondary</p>
<p class="text-success">.text-success</p>
<p class="text-danger">.text-danger</p>
<p class="text-warning bg-dark">.text-warning</p>
36
Ch-5 BootstrapFramework _Practical
Background
1)
<!DOCTYPE html>
<html>
<head>
37
Ch-5 BootstrapFramework _Practical
38
Ch-5 BootstrapFramework _Practical
Output
2)
<!DOCTYPE html>
<html>
<head>
<link href="css/bootstrap.css" rel="stylesheet">
</head>
<body>
<div class="bg-success p-2 text-white">This is default
success background</div>
<div class="bg-success p-2" style="--bs-bg-opacity:
0.5;">This is 50% opacity success background</div>
</body>
</html>
Output
39
Ch-5 BootstrapFramework _Practical
Border Utilities
<!DOCTYPE html>
<html>
<head>
<link href="css/bootstrap.css" rel="stylesheet">
</head>
<body> <!-- border = 6826 -- dotted,dashed,double-->
<span class="border border-2 border-primary
">hello</span>
<span class="border border-secondary">hello</span>
<span class="border border-success">hello</span>
<span class="border border-danger">hello</span>
<span class="border border-warning">hello</span>
<span class="border border-info">hello</span>
<span class="border border-light">hello</span>
<span class="border border-dark">hello</span>
<span class="border border-white">hello</span>
</body>
</html>
Output
40
Ch-5 BootstrapFramework _Practical
Display Utilities
<!DOCTYPE html>
<html>
<head>
<link href="css/bootstrap.css" rel="stylesheet">
<!-- <link href="css/css3/bootstrap.css" rel="stylesheet"> -
->
</head>
<body> <!-- change d-inline to d-inline-block,d-block,d-
table,d-flex,d-none -->
<div class="d-inline p-2 bg-primary">d-inline</div><!--
6689 -->
<div class="d-block p-2 bg-secondary">d-inline</div>
</body>
</html>
Output
Overflow utility
<!DOCTYPE html>
<html>
<head>
41
Ch-5 BootstrapFramework _Practical
43
Ch-5 BootstrapFramework _Practical
Position utility
<!DOCTYPE html>
<html>
<head>
<link href="css/bootstrap.css" rel="stylesheet">
</head>
<body>
<h4 class="mb-4">Position values</h4>
<div class="container mt-4 bg-light border border-
dark">
Position: static states that the top, right,bottom, and
left properties will be the same no matter
<p class="position-static bg-info top-80 text-
light">position: static</p>
This part is out of the paragraph.
</div>
<div class="container mt-4 bg-light border border-
dark">Position: relative sets its position to be relative with
respect to the elements on top of it
<p class="position-relative bg-success top-50
text-light w-30">
position: relative;
</p>
This means that the top, right, bottom, and
44
Ch-5 BootstrapFramework _Practical
45
Ch-5 BootstrapFramework _Practical
Spacing utility
<!DOCTYPE html>
<html>
<head>
<link href="css/bootstrap.css" rel="stylesheet">
</head>
<body><!-- Change gap-4,5 -->
<div class="d-grid gap-3"><!--6701 p=padding p-4/p-5 -->
<div class="p-2 bg-light border">Grid item 1</div>
<div class="p-2 bg-light border">Grid item 2</div>
<div class="p-2 bg-light border">Grid item 3</div>
</div>
</body>
</html>
Output
46
Ch-5 BootstrapFramework _Practical
Text utility
<!DOCTYPE html>
<html>
<head>
<link href="css/bootstrap.css" rel="stylesheet">
</head>
<body>
<p class="text-start text-info">Text aligned at starting
position across all viewports sizes.</p>
<p class="text-center text-danger">Text aligned at center
position across all viewports sizes.</p>
<p class="text-end text-warning">Text aligned at end
position across all viewports sizes.</p>
</body>
</html>
Output
Vertical_align Utility
<!DOCTYPE html>
<html>
<head>
<!-- <link href="css/bootstrap.css" rel="stylesheet"> -->
<link href="css/bootstrap.css" rel="stylesheet">
47
Ch-5 BootstrapFramework _Practical
</head>
<body>
<table class="border" style="height: 100px;">
<tbody>
<tr >
<td class="align-baseline">baseline</td>
<td class="align-top">top</td>
<td class="align-text-top">text-top</td>
<td class="align-middle">middle</td>
<td class="align-bottom">bottom</td>
</tr>
</tbody>
</table>
</body>
</html>
Output
48
Ch-5 BootstrapFramework _Practical
Bootstrap Components
Navbar
<!DOCTYPE html>
<html>
<head>
<link href="css/css3/bootstrap.css" rel="stylesheet">
<!-- <script src="js/bootstrap.min.js"></script> -->
</head>
<body>
<nav class = "navbar navbar-default">
<div class="navbar-header">
<a class="navbar-brand" href="#">WebSiteName</a>
</div>
49
Ch-5 BootstrapFramework _Practical
2) fixed-top navbar
<!DOCTYPE html>
<html>
<head>
<link href="css/css3/bootstrap.css" rel="stylesheet">
<!-- <script src="js/bootstrap.min.js"></script> -->
50
Ch-5 BootstrapFramework _Practical
</head>
<body style="height:1500px">
51
Ch-5 BootstrapFramework _Practical
52
Ch-5 BootstrapFramework _Practical
3) navbar-fixed-bottom
<!DOCTYPE html>
<html>
<head>
<link href="css/css3/bootstrap.css" rel="stylesheet">
<!-- <script src="js/bootstrap.min.js"></script> -->
</head>
<body style="height:1500px">
<nav class = "navbar navbar-default navbar-fixed-bottom"
role = "navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#">WebSiteName</a>
</div>
<ul class="nav navbar-nav">
<li class="active"><a href="#">Home</a></li>
<li><a href="#">Page 1</a></li>
<li><a href="#">Page 2</a></li>
<li><a href="#">Page 3</a></li>
</ul>
</div>
</nav>
<div class="container" style="margin-top:50px">
53
Ch-5 BootstrapFramework _Practical
<h3>Fixed Navbar</h3>
<div class="row">
<div class="col-md-4">
<p>A fixed navigation bar stays visible in a fixed position
(top or bottom) independent of the page scroll.</p>
<p>A fixed navigation bar stays visible in a fixed position
(top or bottom) independent of the page scroll.</p>
</div>
<div class="col-md-4">
<p>A fixed navigation bar stays visible in a fixed position
(top or bottom) independent of the page scroll.</p>
<p>A fixed navigation bar stays visible in a fixed position
(top or bottom) independent of the page scroll.</p>
</div>
<div class="col-md-4">
<p>A fixed navigation bar stays visible in a fixed position
(top or bottom) independent of the page scroll.</p>
<p>A fixed navigation bar stays visible in a fixed position
(top or bottom) independent of the page scroll.</p>
</div>
</div>
</div>
<h1>Scroll this page to see the effect</h1>
54
Ch-5 BootstrapFramework _Practical
</body>
</html>
Output
55
Ch-5 BootstrapFramework _Practical
Dropdown
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="css\bootstrap.min.css">
<script src="Jquery\jquery.min.js"></script>
<script src="js\bootstrap.min.js"></script>
</head>
56
Ch-5 BootstrapFramework _Practical
<body>
<div class="dropdown">
<button class="btn btn-primary dropdown-toggle"
type="button" data-toggle="dropdown">Dropdown Example
<span class="caret"></span></button>
<ul class="dropdown-menu">
<li><a href="#">HTML</a></li>
<li><a href="#">CSS</a></li>
<li><a href="#">JavaScript</a></li>
</ul>
</div>
</div>
</body>
</html>
Output
Button
<!DOCTYPE html>
<html>
<head>
57
Ch-5 BootstrapFramework _Practical
<br>
<br>
<br>
58
Ch-5 BootstrapFramework _Practical
59
Ch-5 BootstrapFramework _Practical
Button group
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="css\bootstrap.min.css">
<script src="Jquery\jquery.min.js"></script>
<script src="js\bootstrap.min.js"></script>
</head>
<body>
<div class="btn-group">
<button type="button" class="btn btn-
primary">Apple</button>
<button type="button" class="btn btn-
primary">Samsung</button>
<button type="button" class="btn btn-
primary">Sony</button>
</div>
<br>
<br>
<br>
<div class="btn-group-vertical">
<button type="button" class="btn btn-
primary">Apple</button>
60
Ch-5 BootstrapFramework _Practical
61
Ch-5 BootstrapFramework _Practical
breadcrumb
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="css\bootstrap.min.css">
<link rel="stylesheet" href="css\bootstrap.css">
<script src="Jquery\jquery.min.js"></script>
<script src="js\bootstrap.min.js"></script>
</head>
<body>
<div>
<ol class="breadcrumb">
<li class="breadcrumb-item active" aria-
current="page">Home</li>
</ol>
<ol class="breadcrumb">
<li class="breadcrumb-item"><a
href="#">Home</a></li>
<li class="breadcrumb-item active" aria-
current="page">Services</li>
</ol>
<ol class="breadcrumb">
<li class="breadcrumb-item"><a
href="#">Home</a></li>
62
Ch-5 BootstrapFramework _Practical
<li class="breadcrumb-item"><a
href="#">Services</a></li>
<li class="breadcrumb-item active" aria-
current="page">Contact</li>
</ol>
</div>
</body>
</html>
Output
Pagination
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="css\bootstrap.min.css">
<script src="Jquery\jquery.min.js"></script>
<script src="js\bootstrap.min.js"></script>
</head>
<body>
63
Ch-5 BootstrapFramework _Practical
Labels
<!DOCTYPE html>
<html>
<head>
<link href="css/css3/bootstrap.css" rel="stylesheet">
64
Ch-5 BootstrapFramework _Practical
<!DOCTYPE html>
<html>
<head>
<link href="css/css3/bootstrap.css" rel="stylesheet">
<script src="js/bootstrap.min.js"></script>
</head>
65
Ch-5 BootstrapFramework _Practical
<body>
<p class="label label-default">Default Label</p>
<p class="label label-primary">Primary Label</p>
<p class="label label-success">Success Label</p>
<p class="label label-info">Info Label</p>
<p class="label label-warning">Warning Label</p>
<p class="label label-danger">Danger Label</p>
</body>
</html>
Output
Alerts
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="css\bootstrap.min.css">
<script src="Jquery\jquery.min.js"></script>
<script src="js\bootstrap.min.js"></script>
</head>
<body>
66
Ch-5 BootstrapFramework _Practical
</div>
<div class="alert alert-primary" role="alert">
A simple primary alert with <a href="#" class="alert-
link">an example link</a>. Give it a click if you like.
</div>
<div class="alert alert-secondary" role="alert">
A simple secondary alert with <a href="#" class="alert-
link">an example link</a>. Give it a click if you like.
</div>
<div class="alert alert-success" role="alert">
<h4 class="alert-heading">Well done!</h4>
<p>Aww yeah, you successfully read this important alert
message. This example text is going to run a bit longer so that
you can see how spacing within an alert works with this kind
of content.</p>
</div>
</body>
</html>
Output
68
Ch-5 BootstrapFramework _Practical
Progress Bars
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="css\bootstrap.min.css">
<link rel="stylesheet" href="css\bootstrap.css">
<script src="Jquery\jquery.min.js"></script>
<script src="js\bootstrap.min.js"></script>
</head>
<body>
<h4>Progress Bar</h4><br>
<div class="progress">
<div class="progress-bar role="progressbar"
style="width: 15%" aria-valuenow="0" aria-valuemin="0"
aria-valuemax="100"></div>
69
Ch-5 BootstrapFramework _Practical
</div><br>
<div class="progress" style="height: 20px;">
<div class="progress-bar progress-bar-info progress-bar-
striped" role="progressbar" style="width: 25%" aria-
valuenow="25" aria-valuemin="0" aria-
valuemax="100"></div>
</div><br>
<div class="progress" style="height: 30px;">
<div class="progress-bar bg-info" role="progressbar"
style="width: 50%" aria-valuenow="50" aria-valuemin="0"
aria-valuemax="100">50%</div>
</div><br>
<div class="progress">
<div class="progress-bar" role="progressbar"
style="width: 75%" aria-valuenow="75" aria-valuemin="0"
aria-valuemax="100"></div>
</div><br>
<div class="progress">
<div class="progress-bar" role="progressbar"
style="width: 100%" aria-valuenow="100" aria-valuemin="0"
aria-valuemax="100"></div>
</div>
</body>
</html>
Output
70
Ch-5 BootstrapFramework _Practical
Accordion
<!DOCTYPE html>
<html>
<head>
<link href="css/bootstrap.min.css" rel="stylesheet">
<script src="js/bootstrap.min.js"></script>
</head>
<body>
<div class="accordion accordion-flush"
id="basicAccordion">
<div class="accordion-item">
<h2 class="accordion-header">
<button class="accordion-button" type="button" data-
bs-toggle="collapse" data-bs-target="#firstCollapse" aria-
expanded="false" aria-controls="firstCollapse">
Bootstrap - Accordian
</button>
</h2>
71
Ch-5 BootstrapFramework _Practical
</div>
</body>
</html>
Output
Card
<!DOCTYPE html>
<html>
<head>
<link href="css/bootstrap.css" rel="stylesheet">
<script src="js/bootstrap.min.js"></script>
</head>
<body>
<div class="card" style="width: 18rem;"> <!-- 4489-->
<img src="2.jpg" class="card-img-top" alt="..."> <!--
4593 -->
<div class="card-body"> <!-- 4523 -->
<h5 class="card-title">Card title</h5><!-- 4528 -->
73
Ch-5 BootstrapFramework _Practical
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<link href="css/bootstrap.min.css" rel="stylesheet">
<script src="js/bootstrap.min.js"></script>
74
Ch-5 BootstrapFramework _Practical
</head>
<body>
<div class="container mt-3">
<h2>Cards with Contextual Classes</h2>
<div class="card">
<div class="card-body">Basic card</div>
</div>
<br>
<div class="card bg-primary text-white">
<div class="card-body">Primary card</div>
</div>
<br>
<div class="card bg-success text-white">
<div class="card-body">Success card</div>
</div>
<br>
<div class="card bg-info text-white">
<div class="card-body">Info card</div>
</div>
<br>
<div class="card bg-warning text-white">
<div class="card-body">Warning card</div>
</div>
75
Ch-5 BootstrapFramework _Practical
<br>
<div class="card bg-danger text-white">
<div class="card-body">Danger card</div>
</div>
<br>
<div class="card bg-secondary text-white">
<div class="card-body">Secondary card</div>
</div>
<br>
<div class="card bg-dark text-white">
<div class="card-body">Dark card</div>
</div>
<br>
<div class="card bg-light text-dark">
<div class="card-body">Light card</div>
</div>
</div>
</body>
</html>
Output
76
Ch-5 BootstrapFramework _Practical
modal
<!DOCTYPE html>
<html>
<head>
<link href="css/bootstrap.css" rel="stylesheet">
<script src="js/bootstrap.min.js">
</script>
</head>
<body>
<!-- Button trigger modal -->
<button type="button" class="btn btn-primary" data-bs-
toggle="modal" data-bs-target="#exampleModal">
Launch demo modal
</button>
77
Ch-5 BootstrapFramework _Practical
78
Ch-5 BootstrapFramework _Practical
</body>
</html>
Output
<!DOCTYPE html>
<html lang="en">
<head>
<link href="css/bootstrap.css" rel="stylesheet">
<script src="js/bootstrap.bundle.min.js"></script>
</head>
<body>
79
Ch-5 BootstrapFramework _Practical
80
Ch-5 BootstrapFramework _Practical
81
Ch-5 BootstrapFramework _Practical
</div>
<!-- Modal footer -->
<div class="modal-footer">
<button type="button" class="btn btn-danger" data-bs-
dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</body>
</html>
Output
82