Professional Documents
Culture Documents
Section 4 (Bootstrap)
Bootstrap Basics
Bootstrap?
● Bootstrap (or Twitter bootstrap)
○ is a framework (the popular front-end or UI framework)
■ A framework is often nothing more than a collection of existing technologies,
bundled together in a new, novel, and consistent way.
○ includes HTML and CSS based design templates for forms, buttons, tables,
navigation, modals, image carousels and many other, as well as optional
JavaScript plugins
Bootstrap 4 & 5
● Bootstrap 5 is the newest version of Bootstrap; with new components,
faster stylesheet and more responsiveness.
● Bootstrap 4 supports the stable releases of all major browsers and
platforms.
How to Use Twitter Bootstrap
● There are two ways to start using Bootstrap 4 on your own web site.
<head>
<!-- loads the CSS - the actual bootstrap styling (most important) -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
○ The .container-fluid class provides a full width container, spanning the entire width of
the viewport
● Container Padding
○ By default, containers have 15px left and right padding, with no top or bottom
padding.
○ If you do not want to use all 12 columns individually, you can group the columns
together to create wider columns
○ is responsive, and the columns will re-arrange automatically depending on the screen
size.
Grid Layout (2-2)
• The first star (*) represents the responsiveness: sm, md, lg or xl,
● How to write pages
• the using
second a grid: a number, which should add up to 12 for each row.
star represents
● Examples
Lets practice on
Bootstrap
Tables
Try other table’s classes (at w3schools) such as (1) table-dark,
A basic Bootstrap
(2)●contextual classes4for
table has a light
coloring padding and horizontal dividers.
it like
● The .table class adds basic styling to a table
● Examples
Bootstrap Buttons
All textual <input>, <textarea>, and <select> elements with class .form-control have a width of 100%.
Try
●
form validation
● Bootstrap provides two types of form layouts:
○ Inline form
Bootstrap Images
● Bootstrap 4 provides the following classes for images:
○ Rounded Corners
■ The .rounded class adds rounded corners to an image
○ Circle
■ The .rounded-circle class shapes the image to a circle
○ Thumbnail
■ The .img-thumbnail class shapes the image to a thumbnail (bordered)
○ Responsive Images
■ Create responsive images by adding an .img-fluid class to the <img> tag. The
image will then scale nicely to the parent element.
● The . img-fluid class applies display: block; and max-width:
100%; and height: auto; to the image
× (×) is an HTML entity that is the preferred
icon for close buttons, rather than the letter "x".
Bootstrap Alerts
• For creating horizontal bar
• Remove it to create a vertical navigation bar
● https://www.w3schools.com/bootstrap/default.asp
Bootstrap Recourses
Bootstrap Themes and Templates
● You can find several templates and themes free to download