INTRODUCTION-TO-BOOTSRAP
INTRODUCTION-TO-BOOTSRAP
INTRODUCTION-TO-BOOTSRAP
Computing
(CCIS1101)
Lesson 9:
Bootstrap
Objectives of this Discussion:
• Explain the fundaments of the Bootstrap framework,
including its grid system, components, and utility classes..
Responsiveness:
- The grid system is designed to be responsive.
- Content automatically adjusts to fit various
screen sizes.
Understanding Grid System
Mobile-first approach - Content starts as a
single column on small screens and scales
up
Understanding Grid System
Mobile-first approach - Content starts as a
single column on small screens and scales
up
Bootstrap Containers
Container – It is used to pad the content inside of
them, and there are two container classes available:
.container-fluid class
Grid Basics of Bootstrap
• The grid system is a fundamental concept in
Bootstrap.
• It helps structure your website's layout and
design.
• The grid system is based on a 12-column
layout.
Grid Classes of Bootstrap
• Bootstrap provides classes for specifying
the width of columns.
• Examples
col-12 (full width)
col-6 (half width)
col-4 (one-third width)
Grid Classes of Bootstrap
Create 2-column even row
<div class="row">
<div class="col-6"></div>
<div class="col-6"></div>
</div>
Example
Create a two-column row within a larger column.
Components of
Bootstrap
(1) Typography
• Typography plays a crucial role in web
design.
• Bootstrap provides a set of typography
classes for text formatting.
Typography Classes
• .h1 to .h6 - Header styles for different levels of
headings.
• .lead - Create a lead paragraph for emphasis.
• .small - Style text to be smaller and less
prominent.
• .text-muted, .text-primary, .text-success, etc. -
Apply various text color classes.
Typography Classes
• .text-center, .text-right, .text-justify - Align
text as needed.
• .font-weight-bold, .font-weight-normal -
Adjust font weight.
• .font-italic - Make text italic.
• .text-uppercase, .text-lowercase, .text-
capitalize - Modify text case.
Typography Classes
• .text-center, .text-right, .text-justify - Align
text as needed.
• .font-weight-bold, .font-weight-normal -
Adjust font weight.
• .font-italic - Make text italic.
• .text-uppercase, .text-lowercase, .text-
capitalize - Modify text case.
Typography Classes
Example:
<h1 class="display-4">Bootstrap
Typography</h1>
<p class="lead">Enhance your web design
with Bootstrap's typography classes.</p>
<p class="text-muted">Customize text
styles to match your design vision.</p>
(2) Colors
• Colors are a vital element in web design,
impacting aesthetics and user experience.
<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>
(7) Badges
• Badges are small, often colorful, elements used to add information or
notifications to content.
• You can apply badges to various elements, like buttons, headings, and
links.
• Use the .badge class together with a contextual class (like .bg-
secondary) within <span> elements to create rectangular badges.
Badge Colors
• Bootstrap allows you to apply different
background colors to badges.
• Common colors include primary,
secondary, success, danger, warning, and
info.
Pill Badges
• To create a rounded badge, use the .
rounded-pill class.
<div class="carousel-inner">
<div class="carousel-item active">
<img src=“apple.jpg" alt=“Apple" class="d-block w-100">
</div>
<div class="carousel-item">
<img src=“mango.jpg" alt=“Mango" class="d-block w-100">
</div>
<div class="carousel-item">
<img src=“banana.jpg" alt=“Banana" class="d-block w-100">
</div>
</div>
Captions to Slides
• Add elements inside <div class="carousel-caption">
within each <div class="carousel-item"> to create a
caption for each slide
<div class="carousel-item">
<img src=“apple.jpg" alt=“Apple">
<div class="carousel-caption">
<h3>Apple</h3>
<p>Apple is a fruit which contains a lot of fiber.</p>
</div>
</div>
Navigation
• Bootstrap carousels come with navigation controls for moving
between slides.
• You can also add custom navigation buttons.
.slide Adds a CSS transition and animation effect when sliding from one item to
the next. Remove this class if you do not want this effect
Questions?
Thank you!