BootStrap Numbered
BootStrap Numbered
Bootstrap
Introduction to Bootstrap
• “Bootstrap” is a “CSS framework”, developed by “Twitter” company, which is a collection of ready-
made “css classes”, which can be used in web pages to apply styles to the elements easily.
• Bootstrap can be used without css knowledge also. To customize the bootstrap styles, CSS
knowledge is required.
• Bootstrap provides responsive web design by default.
• Bootstrap was developed based on “jQuery” and "Popper".
• jQuery is a JavaScript library, which provides a set of functions to perform DOM manipulations
easily.
• Popper is a JavaScript library, which provides a set of functions to display popup messages.
Downloading Bootstrap
• Go to “http://getbootstrap.com”.
• Select the latest version in the dropdownlist (Ex: v4.1). It by default, selects the latest version.
• Click on “Download”.
• Click on “Download” again under "Compiled CSS and JS".
• Download the file “bootstrap-4.1.1.zip”.
• Go to the downloaded location, right click on the “bootstrap-4.1.1.zip” file and click on “Extract All”.
• After extracting, you will get extracted folder.
• Copy the following files from “extracted folder (bootstrap-4.1.1)”, into “application folder
(c:\bootstrap)”.
▪ css\bootstrap.css
▪ js\bootstrap.js
Downloading jQuery
• Go to “http://jquery.com”.
• Click on “Download jQuery 3.3.1” (version number may vary).
• Click on “Download the uncompressed, development jQuery 3.3.1”.
• If required, press "Ctrl+S" to save the file. You will get a file “jquery-3.3.1.js”.
• Copy and paste “jquery-3.3.1.js” file from Downloaded location into “c:\bootstrap” folder.
1
UI Technologies
Downloading Popper
• Go to “https://unpkg.com/popper.js”.
• If required, press "Ctrl+S" to save the file. You will get a file “popper.js”.
• Copy and paste “popper.js” file from Downloaded location into “c:\bootstrap” folder.
Importing Bootstrap
Importing Bootstrap
• The "viewport meta tag" is used to set the actual width of the device as width of the web page.
• It is must to make the web page responsive.
• It also sets the initial zoom to "1" (actual size).
2
UI Technologies
“container” class
• It acts as “outer container” for the entire page.
• It makes the web page responsive.
• The entire content of the page should be inside the “container”.
• It provides margin left and margin right for the page.
Syntax:
<div class=”container”>
any content
</div>
Example on Container
“container-fluid” class
• It also acts as “outer container” for the entire page.
• It also makes the web page responsive.
• The entire content of the page should be inside the “container-fluid”.
3
UI Technologies
• It removes margin left and margin right for the page. It makes the content occupy the full available
width of the web page.
Syntax:
<div class=”container”>
any content
</div>
Example on Container-Fluid
Text Colors
• It is used to set colors of the text.
• Based on the requirement, the developer can use any of the available colors.
• If you want other color, you can use CSS.
4
UI Technologies
List of Classes
• text-primary : Blue text color
• text-success : Green text color
• text-info : Light blue text color
• text-warning : Orange text color
• text-danger : Red text color
• text-muted : Grey color
• text-secondary : Darker grey text color
• text-dark : Dark grey text color
• text-light : Light grey text color
5
UI Technologies
Background Colors
• It is used to set background colors of the element.
• Based on the requirement, the developer can use any of the available colors.
• If you want other color, you can use CSS.
List of Classes
• bg-primary : Blue background color
• bg-success : Green background color
• bg-info : Light blue background color
• bg-warning : Orange background color
• bg-danger : Red background color
• bg-secondary : Grey background color
• bg-dark : Dark grey background color
• bg-light : Light grey background color
6
UI Technologies
7
UI Technologies
Display Headings
• It is used to display headings with thin text and larger font size.
List of Classes
• display-1 : Display Heading 1
• display-2 : Display Heading 2
• display-3 : Display Heading 3
• display-4 : Display Heading 4
8
UI Technologies
Text Alignment
• We can apply text alignment, by using the following bootstrap css classes.
• Default is "left alignment".
List of Classes
• text-left : Left alignment
• text-center : Center alignment
• text-right : Right alignment
• text-justify : Justify alignment
9
UI Technologies
10
UI Technologies
Text Styles
• The following set of bootstrap classes are used to set text styles such as bold, italic, uppercase etc.
List of Classes
• font-weight-bold : Bold text
• font-weight-light : Light weight text
• font-italic : Italic text
• text-lowercase : Lowercase
• text-uppercase : Uppercase
• text-capitalize : Capitalize
11
UI Technologies
Lead
• It is used to display a leading paragraph (in larger font size and more line height).
List of Classes
• lead : Paragraph with larger font size and larger line height
Example on Lead
12
UI Technologies
13
UI Technologies
Visibility
• It is used to show / hide the element in the web page.
List of Classes
• visible : Element is visible
• invisible : Element is invisble
Example on Visibility
14
UI Technologies
List of Classes
• .col-n : Specifies how may columns are occupied by the <div> tag
15
UI Technologies
16
UI Technologies
17
UI Technologies
18
UI Technologies
1 Extra Small Devices 1px to 575px iPhone 2G, 3G (320px / 480px height)
3 Medium Devices 768px to 991px Samsung Note 1 (800px width / 1280px height)
19
UI Technologies
4 Large Devices 992px to 1199px iPhone 6 Plus (1080px width / 1920px height)
iPhone 10 (1125px width / 2436px height)
5 Extra Large Devices 1200px to unlimited iPhone 7+, 8+ (1242px width / 2208px height)
Most-used laptops
Small Devices:
• Low-range phones & Tablets: Screens between 576px to 767px width.
• Ex: iPhone 4, 4s (640px width / 960px height)
• Ex: iPhone 5, 5s, 5C, SE (640px width / 1136px height)
• Ex: iPhone 6, 6s, 7, 8 (750px width / 1334px height)
<div class=”col-sm-n”>…</div>
<div class=”col-sm-n”>…</div>
…
Medium Devices:
• Lower-mid range phones & Small laptops: Screens between 768px to 991px width.
• Ex: Samsung Note 1 (800px width / 1280px height)
<div class=”col-md-n”>…</div>
<div class=”col-md-n”>…</div>
…
Large Devices:
• Mid-range phones & Small laptops: Screens between 992px to 1199px width.
• Ex: iPhone 6 Plus (1080px width / 1920px height)
• Ex: iPhone 10 (1125px width / 2436px height)
<div class=”col-lg-n”>…</div>
20
UI Technologies
<div class=”col-lg-n”>…</div>
…
21
UI Technologies
22
UI Technologies
23
UI Technologies
Jumbotron
• It is used to display heading and paragraph in large size with a special box to highlight its content.
List of Classes
• jumbotron : Large heading and paragraph.
24
UI Technologies
Example on Jumbotron
Image Shapes
• It is used to display images with rounded corners.
List of Classes
• rounded : Rounded corners
• rounded-circle : Circle-shaped image
• img-thumbnail : Bordered image
25
UI Technologies
Image Alignment
• It is used to specify horizontal alignment of the image.
List of Classes
• float-left : Left alignment
• float-right : Right alignment
• mx-auto : Center alignement
• d-block : Display the image as a block; this is needed to apply "mx-auto".
26
UI Technologies
Image Fluid
• It is used to display reduce the size of the image automatically, if the page width is reduced.
List of Classes
• img-fluid : Image size automatically gets reduced if the screen width is reduced.
27
UI Technologies
Basic Table
• It is used to display table with expand width and padding, horizontal borders.
List of Classes
• table : bootstrap table style.
28
UI Technologies
29
UI Technologies
Borderless Table
• It is used to display table without borders.
List of Classes
• table-borderless : Table without border
30
UI Technologies
31
UI Technologies
Bordered Table
• It is used to display table with both horizontal & vertical borders.
List of Classes
• table-bordered : Table with border
32
UI Technologies
33
UI Technologies
Striped Table
• It is used to display table with alternate row background
List of Classes
• table-striped : Table with alternate row background.
34
UI Technologies
35
UI Technologies
Hover Table
• It is used to display table with background color change on row hover.
List of Classes
• table-hover : Table row background color gets changed on hover
36
UI Technologies
37
UI Technologies
List of Classes
• table-primary : Blue color
• table-success : Green color
• table-danger : Red color
• table-info : Light blue color
• table-warning : Orange color
• table-active : Grey color
• table-secondary : Different Grey color
• table-light : Light grey color
• table-dark : Dark grey color
38
UI Technologies
39
UI Technologies
40
UI Technologies
List of Classes
• thead-dark : Black color
• thead-light : Light Grey color
41
UI Technologies
42
UI Technologies
Table Small
• It is used to display table with small size (less padding).
List of Classes
• table-sm : Table with Less padding
43
UI Technologies
Table Responsive
• It is used to display scrollbar for the table automatically, when the web page is resized.
• This class can be applicable only for <div> tag that contains <table> tag.
List of Classes
• table-responsive : Table with scrollbar
44
UI Technologies
45
UI Technologies
Alerts
• It is used to display alert message (short message) at the top of the web page.
List of Classes
• alert : Represents alert
• fade : Show alert with fade
• show : Displays the alert
• close : Displays close button
• alert-primary : Blue color
• alert-success : Green color
• alert-info : Light blue color
• alert-warning : Orange color
• alert-danger : Red color
• alert-secondary : Grey color
46
UI Technologies
Example on Alerts
47
UI Technologies
Button Colors
• It is used to display buttons with different colors.
List of Classes
• btn : Bootstrap button style
• btn-primary : Blue color
• btn-secondary : Grey color
• btn-success : Green color
• btn-info : Light blue color
• btn-warning : Orange color
• btn-danger : Red color
48
UI Technologies
Button Outline
• It is used to display buttons with only border (white background).
49
UI Technologies
List of Classes
• btn-outline-primary : Blue color
• btn-outline-secondary : Grey color
• btn-outline-success : Green color
• btn-outline-info : Light blue color
• btn-outline-warning : Orange color
• btn-outline-danger : Red color
• btn-outline-dark : Black color
• btn-outline-light : Light grey color
50
UI Technologies
Button Sizes
• It is used to display large / small buttons.
List of Classes
• btn-block : Full-width button
• btn-lg : Large button
• btn-sm : Small button
Button Groups
• It is used to display grouped buttons.
• It reduces margin between buttons.
51
UI Technologies
List of Classes
• btn-group : Group of buttons
List of Classes
• btn-group-vertical : Vertical group of buttons
52
UI Technologies
Button DropDown
• It is used to display dropdownlist for the button.
List of Classes
• dropdown-toggle : Dropdown button
• dropdown-toggle-split : Split button
• caret : Caret symbol
• dropdown-menu : Represents the menu
• dropdown-item : Represents item in the menu
53
UI Technologies
Basic Badges
• It is used to indication near heading / button.
List of Classes
• badge : Represents Badge
Example on Badges
54
UI Technologies
Badge Colors
• It is used to set background colors for the badges
List of Classes
• badge-primary : Blue color
• badge-secondary : Grey color
55
UI Technologies
Pill Badges
• It is used to display more rounded badges.
56
UI Technologies
List of Classes
• badge-pill : More rounded badge
List of Classes
• progress : Progress bar container
• progress-bar : Progress
• mx-auto : Center alignment
57
UI Technologies
List of Classes
• bg-success : Green color
• bg-info : Light blue color
• bg-warning : Orange color
• bg-danger : Red color
• bg-secondary : Grey color
• bg-light : Light grey color
• bg-dark : Black color
• progress-bar-striped : Striped progress bar
• progress-bar-animated : Animated progress bar
58
UI Technologies
59
UI Technologies
Basic Pagination
• It is used to display page numbers.
List of Classes
• pagination : Enable pagination style
• page-item : Page number
• page-link : Page number link
• active : Current page
60
UI Technologies
Pagination Size
• It is used to display pagination in large / small size.
List of Classes
• pagination-lg : Large size progress bar
• pagination-sm : Small size progress bar
61
UI Technologies
Pagination Alignment
• It is used to display pagination left / center / right side of the page.
List of Classes
• justify-content-center : Center alignment for pagination
• justify-content-end : Right alignment for pagination
62
UI Technologies
Breadcrumbs
• It is used to display location (navigation path) of the current web page in the website.
63
UI Technologies
List of Classes
• breadcrumb : Represents entire breadcrumb
• breadcrumb-item : Represents single item in the breadcrumb
• active : Represents current item
Example on Breadcrumbs
List of Classes
• list-group : Represents the list
64
UI Technologies
List of Classes
• list-group-item-success : Green color
65
UI Technologies
66
UI Technologies
Basic Cards
• It is used to display some content (box) with header and footer.
List of Classes
• card : Represents entire card
• card-header : Header of card
• card-body : Content of card
• card-footer : Footer of card
67
UI Technologies
Card Colors
• It is used to display some content (box) with header and footer.
List of Classes
• bg-primary : Blue color
• bg-success : Green color
• bg-info : Light blue color
• bg-warning : Orange color
• bg-danger : Red color
• bg-secondary : Grey color
• bg-dark : Black color
68
UI Technologies
69
UI Technologies
Card Images
• It is used to display cards with images.
List of Classes
• card-img-top : Represents card image at top
• card-img-bottom : Represents card image at bottom
• card-title : Title of the card
• card-text : Normal text of the card
70
UI Technologies
Card Groups
• It is used to display group of cards side by side.
List of Classes
• card-group : Group of cards
71
UI Technologies
72
UI Technologies
Tooltip
• It is used to display tooltip message when the user places mouse pointer on it.
List of Classes
• data-toggle="tooltip" : Enables tooltip for the element
• data-placement="top | bottom | left | right" : Specifies position of tooltip
• title : Tooltip text
Example on Tooltip
73
UI Technologies
Popover
• It is used to display message (some text) when the user clicks an element.
• The popover can show when the cursor focuses the element.
• The popover can have title and content also.
List of Classes
• data-toggle="popover" : Enables popover
• title : Title of popover
• data-content="some text" : Text of popover
• data-placement="top | bottom | left | right" : Position of popover
• data-trigger="focus" : Show popover on focus
Example on Popover
74
UI Technologies
Basic Collapsible
• It is used to display expandable / collapsible content.
• The content will be shown when the user clicks on the button / link.
List of Classes
• collapse : Represents collapsible container.
• data-toggle="collapse" : Enables collapsible content, when button is clicked
• data-target="#id" : Connects the button with collapsible container.
75
UI Technologies
Link Collapsible
• It is used to display expandable / collapsible content, based on the link.
• The content will be shown when the user clicks on the link.
List of Classes
• show : Shows the collapsible content by default, while page is loading.
76
UI Technologies
Accordion
• It is used to display a group of collapsible items and show any one of them, when the user clicks it.
• Out of few collapsible items, only one is visible to the user.
List of Classes
• show : Shows the card
• data-parent="id" : Specifies reference to the parent div
Example on Accordion
77
UI Technologies
78
UI Technologies
Inline Form
• It is used to create a simple form (with limited no. of elements), where the elements appear side-by-
side.
List of Classes
• form-inline
• form-group
• form-control
• mr-n
• form-check
• form-check-label
79
UI Technologies
• form-check-input
Stacked Form
• It is used to create a form, where the form elements appear line-by-line.
List of Classes
• form-text
80
UI Technologies
• form-control-file
81
UI Technologies
82
UI Technologies
Form Grid
• It is used to create a form, where the desired form elements appear side-by-side.
List of Classes
• form-row
83
UI Technologies
84
UI Technologies
List of Classes
• form-row
• col-sm-n
• col-form-label
• offset-sm-n
85
UI Technologies
86
UI Technologies
87
UI Technologies
Input Groups
• It is used to create a form element, with some text inside it.
List of Classes
• input-group
• input-group-prepend
• input-group-append
• input-group-text
88
UI Technologies
Form Validation
• It is used to display success message / error message, based on the value that is entered by the user.
List of Classes
• needs-validation
89
UI Technologies
• novalidate="novalidate"
• valid-feedback
• invalid-feedback
• valid-tooltip
• invalid-tooltip
• required="required"
• pattern="reg exp"
90
UI Technologies
91
UI Technologies
Basic Navigation
• It is used to display a simple navigation bar with few hyperlinks
• When the user clicks on any hyperlink, the corresponding web page (html file) will be opened.
List of Classes
• nav
• nav-item
• nav-link
92
UI Technologies
Navigation Alignment
• It is used to set alignment for the simple navigation bar.
• Default is left alignment.
• You can set center / right alignment.
List of Classes
• justify-content-center
• justify-content-end
93
UI Technologies
Vertical Navigation
• It is used to display the simple navigation bar in vertical mode.
94
UI Technologies
List of Classes
• flex-column
95
UI Technologies
Tabs
• It is used to display a set of tabs and show the corresponding content below, when the user clicks
on any one tab.
List of Classes
• nav-tabs
• data-toggle="tab"
• tab-content
• tab-pane
• container
• active
• fade
Example on Tabs
96
UI Technologies
Pills
• It is used to display a set of tabs with more rounded corners and background color.
List of Classes
• nav-pills
• data-toggle="pill"
Example on Pills
97
UI Technologies
98
UI Technologies
List of Classes
• dropdown
• dropdown-toggle
• data-toggle="dropdown"
• dropdown-menu
• dropdown-item
Example on DropDown
99
UI Technologies
100
UI Technologies
List of Classes
• navbar
• navbar-expand-sm
• navbar-dark
• navbar-nav
• nav-item
• nav-link
• active
home.html
about.html
101
UI Technologies
contact.html
102
UI Technologies
NavBar Collapsible
• It is used to display a collapsible navbar. That means when the web page has been opened in small
devices, the menu will be automatically converted into "=" icon. When the user clicks on this icon,
the menu gets opened.
List of Classes
• navbar-expand-sm
• navbar-brand
• navbar-toggler
• data-toggle="collapse"
• data-target="#id"
• collapse
• navbar-collapse
103
UI Technologies
NavBar DropDown
• It is used to display a dropdown menu for the navigation bar item.
List of Classes
• dropdown
• dropdown-toggle
• data-toggle="dropdown"
104
UI Technologies
• dropdown-menu
• dropdown-item
105
UI Technologies
NavBar Search
• It is used to display a search box for the navigation bar.
List of Classes
• form-inline
• form-control
• mr-sm-n
106
UI Technologies
107
UI Technologies
NavBar FixedTop
• It is used to display a navbar always at the top of the page, even though the user has scrolled the
page up / down.
List of Classes
• fixed-top
108
UI Technologies
List of Classes
• sticky-top
109
UI Technologies
110
UI Technologies
Scrollspy
• It is used to change the "active" class to the current menu item, when the web page is scrolled
vertically.
111
UI Technologies
List of Classes
• data-spy="scroll"
• data-target=".navbar"
• data-offset="pixels"
Example on ScrollSpy
112
UI Technologies
113
UI Technologies
Carousel
• It is used to display image slide show with / without text.
List of Classes
• carousel
• slide
• data-ride="carousel"
• data-interval="milli seconds"
• carousel-indicators
• data-target="#id"
• data-slide-to="n"
• active
• carousel-inner
• carousel-item
• carousel-caption
• carousel-control-prev
• carousel-control-prev-icon
• data-slide="prev"
• data-slide="next"
114
UI Technologies
Example on Carousel
115
UI Technologies
116
UI Technologies
Modal
• It is used to display modal popup box with desired content.
List of Classes
• data-toggle="modal"
• data-target="#id"
• modal
• fade
• modal-dialog
• modal-lg
• modal-dialog-centered
• modal-content
• modal-header
• modal-body
• modal-footer
• close
• data-dismiss="modal"
Example on Modal
117
UI Technologies
118
UI Technologies
LESS
Introduction to LESS
• LESS stands for "LEAN CSS".
• "LESS" makes it easy to modify the CSS file. If you make the change in one place, the same will be
automatically effected in multiple places.
• The LESS code is written in ".less" files and will be converted into "css" files, as the browser supports
only CSS, but not LESS.
• If you modify the the LESS file and compile it into CSS file, the change will be effected in multiple
places in CSS.
• Additionally, LESS supports some additional features such as variables, operators, mixins, color
functions etc., which are not supported by CSS. LESS is the superset of CSS, which supports all
concepts of CSS along with the specified additional features.
119
UI Technologies
• Click on "Download".
• You will get a file called "WinLess-1.9.1.msi".
120
UI Technologies
• Check the checkbox "I accept the terms in the License Agreement".
• Click on "Install".
121
UI Technologies
• Click on "Finish".
122
UI Technologies
123
UI Technologies
124
UI Technologies
125
UI Technologies
126
UI Technologies
• WinLess opened.
127
UI Technologies
• It shows the list of LESS files automatically. It also generates CSS filename automatically.
• Click on "Compile".
128
UI Technologies
129
UI Technologies
130
UI Technologies
131
UI Technologies
Variables
• In LESS, variables are used to store a value.
• The variable create once, can be used many times within the same less file. While converting into
CSS, the variables will be replaced with actual value.
• Variable names must be started with "@".
132
UI Technologies
Mixins
• Mixins are used to mix a CSS class with another style.
133
UI Technologies
Example on Mixins
c:\ui\StyleSheet.less
c:\ui\Page1.html
134
UI Technologies
c:\ui\StyleSheet.less
c:\ui\Page1.html
135
UI Technologies
Nested Rules
• These are used to apply CSS styles for the child elements of a specific parent tag.
parenttag child2
{
}
136
UI Technologies
c:\ui\Page1.html
Operators
• In LESS, we can use all the arithmetical operators such as +, -, *, / etc.
• The LESS compiler calculates the operators and generates the result.
137
UI Technologies
Example on Operators
c:\ui\StyleSheet.less
c:\ui\Page1.html
Color Functions
• These are used to make the color darker / lighter.
138
UI Technologies
lighten(color, percentage);
Example on Operators
c:\ui\StyleSheet.less
c:\ui\Page1.html
139