0% found this document useful (0 votes)
72 views

Intro To Bootstrap

Bootstrap is a popular front-end framework for building responsive mobile-first websites. It includes HTML and CSS templates for common elements like grids, tables, forms, buttons, navigation and more. Developers can use Bootstrap to quickly design prototypes and build user interfaces without having to write CSS from scratch. The framework is open source and supported by a large community.

Uploaded by

Jason Magsino
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
72 views

Intro To Bootstrap

Bootstrap is a popular front-end framework for building responsive mobile-first websites. It includes HTML and CSS templates for common elements like grids, tables, forms, buttons, navigation and more. Developers can use Bootstrap to quickly design prototypes and build user interfaces without having to write CSS from scratch. The framework is open source and supported by a large community.

Uploaded by

Jason Magsino
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 27

INTRODUCTION TO

BOOTSTRAP
WeeK 4-5 topic
What is Bootstrap?

• Twitter Bootstrap is the most popular front end


framework in the recent time. It is sleek, intuitive, and
powerful mobile first front-end framework for faster
and easier web development. It uses HTML, CSS and
Javascript.
Goals of the topic

• teach you the basics of Bootstrap Framework using which you can create
web projects with ease.
• divided into sections such as Bootstrap Basic Structure, Bootstrap CSS,
Bootstrap Layout Components and Bootstrap Plugins.
BOOTSTRAP
• Bootstrap is a sleek, intuitive, and
powerful, mobile first front-end framework
for faster and easier web development. It
uses HTML, CSS, and Javascript.
• Bootstrap was developed by Mark Otto
and Jacob Thornton at Twitter. It was
released as an open source product in
August 2011 on GitHub.
Why
use BOOTSTRAP?

• Mobile first approach: Bootstrap 3 framework consists of Mobile first


styles throughout the entire library instead of them in separate files.
• Browser Support: It is supported by all popular browsers:
Why
use BOOTSTRAP?

• Easy to get started: With just the knowledge of HTML


and CSS anyone can get started with Bootstrap. Also the
Bootstrap official site has a good documentation.
• Responsive design: Bootstrap's responsive CSS adjusts
to Desktops, Tablets and Mobiles. More about the
responsive design is in the chapter Bootstrap
Responsive Design.
BOOTSTRAP PACKAGE
INCLUDES:

• Scaffolding: Bootstrap provides a basic structure with Grid


System, link styles, and background. This is covered in
detail in the section Bootstrap Basic Structure.
• CSS: Bootstrap comes with the feature of global CSS
settings, fundamental HTML elements styled and enhanced
with extensible classes, and an advanced grid system. This
is covered in detail in the section Bootstrap with CSS.
BOOTSTRAP PACKAGE
INCLUDES:
• Components: Bootstrap contains over a dozen reusable
components built to provide iconography, dropdowns, navigation,
alerts, pop-overs, and much more. This is covered in detail in the
section Layout Components.
• JavaScript Plugins: Bootstrap contains over a dozen custom
jQuery plugins. You can easily include them all, or one by one.
This is covered in details in the section Bootstrap Plugins.
• Customize: You can customize Bootstrap's components, LESS
variables, and jQuery plugins to get your very own version.
Where to Get
Bootstrap?

• There are two ways to start using Bootstrap on your own web site.
– Download Bootstrap from getbootstrap.com
• If you want to download and host Bootstrap yourself, go to
getbootstrap.com, and follow the instructions there.
– Include Bootstrap from a CDN
• If you don't want to download and host Bootstrap yourself, you can
include it from a CDN (Content Delivery Network).
• MaxCDN provides CDN support for Bootstrap's CSS and JavaScript.
You must also include jQuery.
Bootstrap CDN
• You must include the following Bootstrap’s CSS, JavaScript, and jQuery from MaxCDN into your web page.
<!-- Latest compiled and minified Bootstrap CSS -->
<link rel="stylesheet"href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">

<!-- Latest compiled Bootstrap JavaScript -->


<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>

<!-- latest jQuery library -->


<script src="https://code.jquery.com/jquery-latest.js"></script>
• Advantage of using the Bootstrap CDN:
– Many users already have downloaded Bootstrap from MaxCDN when visiting another site. As a result, it will be
loaded from cache when they visit your site, which leads to faster loading time. Also, most CDN's will make sure
that once a user requests a file from it, it will be served from the server closest to them, which also leads to faster
loading time.
Create Web Page
with Bootstrap (1)
• Add the HTML5 doctype
– Bootstrap uses HTML elements and CSS properties that require the HTML5 doctype.
– Always include the HTML5 doctype at the beginning of the page, along with the lang
attribute and the correct character set:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
</head>
</html>
Create Web Page
with Bootstrap
• Containers
– Bootstrap also requires a containing element to wrap site contents.
– There are two container classes to choose from:
• The .container class provides a responsive fixed width container. (
See Sample)
• The .container-fluid class provides a full width container, spanning the
entire width of the viewport. (See Sample)
• Note: Containers are not nestable (you cannot put a container inside another
container).
Bootstrap Grids
• Bootstrap’s grid system allows up to 12 columns across the page.
• If you do not want to use all 12 columns individually, you can group the columns
together to create wider columns:
<div class="col-md-12">Span 12 columns</div>
<div class="col-md-6">Span 6</div><div class="col-md-6">Span 6</div>
<div class="col-md-4">Span 4</div><div class="col-md-8">Span 8</div>
<div class="col-md-4">Span 4</div><div class="col-md-4">Span 4</div> <div
class="col-md-4">Span 4</div>
• Bootstrap's grid system is responsive, and the columns will re-arrange automatically
depending on the screen size.
Grid Classes
• The Bootstrap grid system has four classes:
– xs (for phones)
– sm (for tablets)
– md (for desktops)
– lg (for larger desktops)
• The classes above can be combined to create more
dynamic and flexible layouts.
Mobile First
Strategy

• Content
o Determine what is most important.
• Layout
o Design to smaller widths first.
o Base CSS address mobile device first; media queries address for
tablet, desktops.
• Progressive Enhancement
o Add elements as screen size increases.
Basic Structure of
a Bootstrap Grid
<div class="row">
<div class="col-*-*"></div>
</div>
<div class="row">
<div class="col-*-*"></div>
<div class="col-*-*"></div>
<div class="col-*-*"></div>
</div>
<div class="row">
...
</div>
• First; create a row (<div class="row">). Then, add the desired number of columns (tags with
appropriate .col-*-*classes). Note that numbers in .col-*-* should always add up to 12 for
each row.
Bootstrap Tables
• A basic Bootstrap table has a light padding and only horizontal dividers.
– The .table class adds basic styling to a table:
• Striped Rows
– The .table-striped class adds zebra-stripes to a table:
• Bordered Table
– The .table-bordered class adds borders on all sides of the table and cells:
• Hover Rows
– The .table-hover class enables a hover state on table rows:
• Responsive Tables
– The .table-responsive class creates a responsive table. The table will then scroll
horizontally on small devices (under 768px). When viewing on anything larger than
768px wide, there is no difference:
Bootstrap Images
• Rounded Corners
– The .img-rounded class adds rounded corners to an image (IE8 does not support rounded
corners):
• Circle
– The .img-circle class shapes the image to a circle (IE8 does not support rounded corners):
• Thumbnail
– The .img-thumbnail class shapes the image to a thumbnail:
• Responsive Images
– Images comes in all sizes. So do screens. Responsive images automatically adjust to fit the size
of the screen.
– Create responsive images by adding an .img-responsive class to the <img> tag. The image will
then scale nicely to the parent element.
– The .img-responsive class applies display: block; and max-width: 100%; and height: auto; to the
image:
Bootstrap Buttons
• Button Styles
– Bootstrap provides seven styles of buttons with the following classes:
.btn-default
.btn-primary
.btn-success
.btn-info
.btn-warning
.btn-danger
.btn-link
Bootstrap Button
Elements

• The button classes can be used on the following


elements:
– <a>
– <button>
– <input>
Button Sizes
• Bootstrap provides four button sizes with the following
classes:
.btn-lg
.btn-md
.btn-sm
.btn-xs
Block Level Buttons
• A block level button spans the entire width of the parent
element.
– Add class .btn-block to create a block level button:
Active/Disabled
Buttons

• A button can be set to an active (appear pressed) or a


disabled (unclickable) state:
– The class .active makes a button appear pressed, and
the class .disabled makes a button unclickable:
Bootstrap ─
Typography

• Headings: All HTML headings (h1 to h6) are styled in


Bootstrap. An example is shown below:
Bootstrap ─
Typography
Bootstrap ─
Typography

• Inline Subheadings: To add an inline subheading to any of the


headings, simply add around any of the elements or add .small class and
you will get smaller text in a lighter color as shown in the example
below:
Bootstrap ─
Typography

You might also like