WT Module 4
WT Module 4
WT Module 4
Module 4: Bootstrap
By Pooja Kulkarni
Introduction to Bootstrap
• Bootstrap is a free front-end framework for faster and
easier web development.
<div class="container">
The .container class provides a responsive fixed width
container.
Use the .container class to create a responsive, fixed-
width container.
Its width (max-width) will change on different screen
sizes:
The .container-fluid class provides a full width
container, spanning the entire width of the viewport
Output
<div class="container pt-5"></div>
By default, containers have left and right padding, with no
top or bottom padding.
Therefore, we often use spacing utilities, such as extra
padding and margins to make them look even better.
For example, .pt-5 means "add a large top padding":
</body>
</html>
Example (Local Scope)
<?php
function myTest()
{
$x = 5; // local scope
echo "<p>Variable x inside function is: $x</p>";
}
myTest();
<div class="row">
<div class="col-sm-6 bg-primary text-white">50%</div>
<div class="col-sm-6 bg-dark text-white">50%</div>
</div>
<br>
<div class="row">
<div class="col-sm-4 bg-primary text-
white">33.33%</div>
<div class="col-sm-4 bg-dark text-white">33.33%</div>
<div class="col-sm-4 bg-primary text-
white">33.33%</div>
</div>
<br>
These classes are basically for the navigation bar to take the full
upper width of the page and then we add the homepage and the
other links to i
Inverted Navbar:
It is quite similar to what we studied earlier in
the Basic Navbar section.
.bg-primary – Blue
.bg-success – Green
.bg-warning – Yellow
.bg-danger – Red
.bg-secondary – Grey
.bg-dark – Black
.bg-light – White
Use .bg-color class to change the color of the navbar to
the above-listed colors.
Right-Aligned Navbar:
By default, the links on a navigation bar are arranged on the
left.
Basic breadcrumbs
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,
initial-scale=1">
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.
1/css/bootstrap.min.css">
<script
src="https://ajax.googleapis.com/ajax/libs/jquery/3.
7.1/jquery.min.js"></script>
<script
src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1
/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<h2>Button Styles</h2>
<button type="button" class="btn">Basic</button>
<button type="button" class="btn btn-default">
Default</button>
<button type="button" class="btn btn-primary">
Primary</button>
<button type="button" class="btn btn-success">
Success</button>
<button type="button" class="btn btn-info"> Info</button>
<button type="button" class="btn btn-warning">
Warning</button>
<button type="button" class="btn btn-danger">
Danger</button>
<button type="button" class="btn btn-link">Link</button>
</html> </div> </body>
Output