BOOTSTRAP
BOOTSTRAP
BOOTSTRAP
Starter template:-................................................................................................................................................... 2
Container: - .............................................................................................................................................................. 2
Grid basics:-.............................................................................................................................................................. 3
Basis structure of Grid:- ....................................................................................................................................... 3
Typography:-............................................................................................................................................................ 4
Colors: - .................................................................................................................................................................... 4
Background: -........................................................................................................................................................... 5
................................................................................................................................................................................. 5
Table:- ...................................................................................................................................................................... 5
Contextual Classes: -Contextual classes can be used to color the whole table (<table>),
the table rows (<tr>) or table cells (<td>). ......................................................................................... 5
Table-responsive: - ............................................................................................................................................... 6
Image: - .................................................................................................................................................................... 6
Buttons: -.................................................................................................................................................................. 6
Button size:-......................................................................................................................................................... 6
Button groups:- ........................................................................................................................................................ 6
List :- To create a basic list group, use an <ul> element with class .list-group,
and <li> elements with class .list-group-item: ................................................................................. 7
Dropdown:-.............................................................................................................................................................. 7
................................................................................................................................................................................. 8
Cards: - ..................................................................................................................................................................... 8
Carousel with indecators:- ....................................................................................................................................... 8
Collapse:- ................................................................................................................................................................. 9
Navbar:-
............................................................................................................................................................................... 10
Tooltip: ................................................................................................................................................................... 10
Utilities ................................................................................................................................................................. 12
[A] Borders: ........................................................................................................................................................ 12
1. additive: ................................................................................................................................................. 12
2. Subtractive: ............................................................................................................................................ 12
3. border color: .......................................................................................................................................... 12
4.border-radius: ............................................................................................................................................. 12
Width: ................................................................................................................................................................ 12
Height: ............................................................................................................................................................... 12
Spacing: .............................................................................................................................................................. 13
Display: ............................................................................................................................................................... 13
Starter template:-
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Hello, world!</title>
</head>
<body>
<h1>Hello, world!</h1>
Container: -
We have two classes in it
o The .container class provides a responsive fixed width container
o The .container-fluid class provides a full width container, spanning the
entire width of the viewport
Grid basics:-
***Then, add the desired number of columns (tags with appropriate.col-*-* classes).
The first star (*) represents the responsiveness: sm, md, lg or xl, while the second star
represents a number,
which should add up to 12 for each row.
Typography:-
<blockquote> :-
<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>
<footer class="blockquote-footer">From WWF's website</footer>
</blockquote>
Colors: -
.text-muted
.text-primary
.text-success
.text-info
.text-warning
.text-danger
.text-secondary
.text-dark
.text-body (default
body color/often black)
and
We can also add 50% opacity for black or white text with the .text-black-
50 or .text-white-50 classes
Background: -
.bg-primary
.bg-success
.bg-info
.bg-warning
.bg-danger
.bg-secondary
.bg-dark
.bg-light
Table:-
Class Effect
.table light padding and horizontal dividers
.table-striped adds zebra-stripes to a table
.table-bordered adds borders on all sides of the table and cells
.table-hover adds a hover effect (grey background color) on
table rows
.table-dark adds a black background to the table
.table-borderless removes borders from the table
Contextual Classes: -Contextual classes can be used to color the whole table (<table>),
the table rows (<tr>) or table cells (<td>).
Table-responsive: -
<div class="table-responsive">
<table class="table">
...
</table>
</div>
We can also decide when the table should get a scrollbar, depending on screen width
by using .table-responsive-sm, .table-responsive-md, .table-responsive-lg
, .table-responsive-xl.
Image: -
.img-fluid Make an image responsive
.img-rounded Adds rounded corners to image
.img-circle Crops image to be circle
.img-thumbnail Adds rounded corner + border
Buttons: -
Button size:-
btn btn-lg
btn
btn btn-sm
Button groups:-
Use a <div> element with class .btn-group to create a button group.
Use the class .btn-group-vertical to create a vertical button group.
List :- To create a basic list group, use an <ul> element with class .list-group,
and <li> elements with class .list-group-item:
<ul class="list-group">
<li class="list-group-item">First item</li>
<li class="list-group-item">Second item</li>
<li class="list-group-item">Third item</li>
</ul>
Dropdown:-
<div class="dropdown">
<button type="button" class="btn btn-primary dropdown-toggle" data-
toggle="dropdown">
Dropdown button
</button>
<div class="dropdown-menu">
<a class="dropdown-item" href="#">Link 1</a>
<a class="dropdown-item" href="#">Link 2</a>
<a class="dropdown-item" href="#">Link 3</a>
</div>
</div>
Navbar:-
Tooltip:
<button type="button" class="btn btn-secondary" data-toggle="tooltip" data-
placement="top" title="Tooltip on top">Tooltip on top</button>
2. Subtractive:
<span class="border border-0"></span>
<span class="border border-top-0"></span>
<span class="border border-right-0"></span>
<span class="border border-bottom-0"></span>
<span class="border border-left-0"></span>
3. border color:
syntax: border border-* *
can replace * * by primary, secondary, success, info, warning, danger, dark, light.
4.border-radius:
Use class
Width:
Set the width of an element with the w-* classes (.w-25, .w-50, .w-75, .w-100, .mw-100):
Height:
Set the height of an element with the h-* classes (.h-25, .h-50, .h-75, .h-100, .mh-100):
Spacing:
The classes are used in the format:
Center an element with the .mx-auto class (adds margin-left and margin-right: auto):
Display:
As such, the classes are named using the format:
.d-{value} for xs
.d-{breakpoint}-{value} for sm, md, lg, and xl.