SlideShare a Scribd company logo
1 of 22
CNIT131 Internet Basics &
Beginning HTML
Week 11 – Responsive Web Design
http://fog.ccsf.edu/~hyip
What is Responsive Web Design?
• Responsive web design is about creating web sites which
automatically adjust themselves to look good on all devices, from
small phones to large desktops.
• Bootstrap is the most popular HTML, CSS, and JavaScript framework
for developing responsive, mobile-first web sites.
• Bootstrap is completely free to download and use!
What is Bootstrap?
• Bootstrap is a free front-end framework for faster and easier web
development
• Bootstrap includes HTML and CSS based design templates for
typography, forms, buttons, tables, navigation, modals, image
carousels and many other, as well as optional JavaScript plugins
• Bootstrap also gives you the ability to easily create responsive designs
Bootstrap History
• Bootstrap was developed by Mark Otto and Jacob Thornton at
Twitter, and released as an open source product in August 2011 on
GitHub.
• Advantages of Bootstrap:
• Easy to use: Anybody with just basic knowledge of HTML and CSS can start
using Bootstrap
• Responsive features: Bootstrap's responsive CSS adjusts to phones, tablets,
and desktops
• Mobile-first approach: In Bootstrap 3, mobile-first styles are part of the core
framework
• Browser compatibility: Bootstrap is compatible with all modern browsers
(Chrome, Firefox, Internet Explorer, Safari, and Opera)
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 (2)
• Bootstrap is mobile-first
• Bootstrap 3 is designed to be responsive to mobile devices. Mobile-first styles
are part of the core framework.
• To ensure proper rendering and touch zooming, add the following <meta> tag
inside the <head> element:
<meta name="viewport" content="width=device-width, initial-scale=1">
• The width=device-width part sets the width of the page to follow the screen-
width of the device (which will vary depending on the device).
• The initial-scale=1 part sets the initial zoom level when the page is first loaded
by the browser.
Create Web Page with Bootstrap (3)
• 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.
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.
Three Equal Columns
• Three equal columns (desktop version):
• Three equal columns (tablet version):
• Three equal columns (smart phone version):
Two Unequal Columns
• Two unequal columns (desktop version):
• Two unequal columns (tablet version):
• Two unequal columns (smart phone version):
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:
References
• Discovering the Internet: Complete, Jennifer Campbell, Course
Technology, Cengage Learning, 5th Edition-2015, ISBN 978-1-285-
84540-1.
• Basics of Web Design HTML5 & CSS3, Second Edition, by Terry Felke-
Morris, Peason, ISBN 978-0-13-312891-8.
• W3schools.com

More Related Content

Similar to Responsive web design

Twitter bootstrap training_session_ppt
Twitter bootstrap training_session_pptTwitter bootstrap training_session_ppt
Twitter bootstrap training_session_pptRadheshyam Kori
 
Introduction to BOOTSTRAP
Introduction to BOOTSTRAPIntroduction to BOOTSTRAP
Introduction to BOOTSTRAPJeanie Arnoco
 
Create Responsive Website Design with Bootstrap 3
Create Responsive Website Design with Bootstrap 3Create Responsive Website Design with Bootstrap 3
Create Responsive Website Design with Bootstrap 3Wahyu Putra
 
Bootstrap day1
Bootstrap day1Bootstrap day1
Bootstrap day1Rafi Haidari
 
Bootstrap 3
Bootstrap 3Bootstrap 3
Bootstrap 3Lanh Le
 
FITC - Bootstrap Unleashed
FITC - Bootstrap UnleashedFITC - Bootstrap Unleashed
FITC - Bootstrap UnleashedRami Sayar
 
Node.js 101
 Node.js 101 Node.js 101
Node.js 101FITC
 
Great Responsive-ability Web Design
Great Responsive-ability Web DesignGreat Responsive-ability Web Design
Great Responsive-ability Web DesignMike Wilcox
 
Introduction to Responsive Web Development
Introduction to Responsive Web DevelopmentIntroduction to Responsive Web Development
Introduction to Responsive Web DevelopmentNikhil Baby
 
HTML & CSS #10 : Bootstrap
HTML & CSS #10 : BootstrapHTML & CSS #10 : Bootstrap
HTML & CSS #10 : BootstrapJean Michel
 
Bootstrap Presentation Mitesh
Bootstrap Presentation MiteshBootstrap Presentation Mitesh
Bootstrap Presentation MiteshMitesh Gandhi
 
Bootstrap - Basics
Bootstrap - BasicsBootstrap - Basics
Bootstrap - BasicsFirosK2
 
Twitter bootstrap (css, components and javascript)
Twitter bootstrap (css, components and javascript)Twitter bootstrap (css, components and javascript)
Twitter bootstrap (css, components and javascript)NexThoughts Technologies
 
Anvesh_BOOTSTRAP.pptx
Anvesh_BOOTSTRAP.pptxAnvesh_BOOTSTRAP.pptx
Anvesh_BOOTSTRAP.pptxcontactanveshk50
 
Presentation of bootstrap
Presentation of bootstrapPresentation of bootstrap
Presentation of bootstrap1amitgupta
 

Similar to Responsive web design (20)

Twitter bootstrap training_session_ppt
Twitter bootstrap training_session_pptTwitter bootstrap training_session_ppt
Twitter bootstrap training_session_ppt
 
Introduction to BOOTSTRAP
Introduction to BOOTSTRAPIntroduction to BOOTSTRAP
Introduction to BOOTSTRAP
 
Create Responsive Website Design with Bootstrap 3
Create Responsive Website Design with Bootstrap 3Create Responsive Website Design with Bootstrap 3
Create Responsive Website Design with Bootstrap 3
 
Bootstrap day1
Bootstrap day1Bootstrap day1
Bootstrap day1
 
Bootstrap 3
Bootstrap 3Bootstrap 3
Bootstrap 3
 
FITC - Bootstrap Unleashed
FITC - Bootstrap UnleashedFITC - Bootstrap Unleashed
FITC - Bootstrap Unleashed
 
Node.js 101
 Node.js 101 Node.js 101
Node.js 101
 
Bootstrap 5 ppt
Bootstrap 5 pptBootstrap 5 ppt
Bootstrap 5 ppt
 
Great Responsive-ability Web Design
Great Responsive-ability Web DesignGreat Responsive-ability Web Design
Great Responsive-ability Web Design
 
Introduction to Responsive Web Development
Introduction to Responsive Web DevelopmentIntroduction to Responsive Web Development
Introduction to Responsive Web Development
 
HTML & CSS #10 : Bootstrap
HTML & CSS #10 : BootstrapHTML & CSS #10 : Bootstrap
HTML & CSS #10 : Bootstrap
 
Boot strap
Boot strapBoot strap
Boot strap
 
Bootstrap Presentation Mitesh
Bootstrap Presentation MiteshBootstrap Presentation Mitesh
Bootstrap Presentation Mitesh
 
Bootstrap - Basics
Bootstrap - BasicsBootstrap - Basics
Bootstrap - Basics
 
Bootstrap.pptx
Bootstrap.pptxBootstrap.pptx
Bootstrap.pptx
 
Twitter Bootstrap
Twitter BootstrapTwitter Bootstrap
Twitter Bootstrap
 
Twitter bootstrap (css, components and javascript)
Twitter bootstrap (css, components and javascript)Twitter bootstrap (css, components and javascript)
Twitter bootstrap (css, components and javascript)
 
Anvesh_BOOTSTRAP.pptx
Anvesh_BOOTSTRAP.pptxAnvesh_BOOTSTRAP.pptx
Anvesh_BOOTSTRAP.pptx
 
Presentation of bootstrap
Presentation of bootstrapPresentation of bootstrap
Presentation of bootstrap
 
Boostrap - Start Up
Boostrap - Start UpBoostrap - Start Up
Boostrap - Start Up
 

Recently uploaded

How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)Dr. Mazin Mohamed alkathiri
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxJiesonDelaCerna
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 

Recently uploaded (20)

How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptx
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 

Responsive web design

  • 1. CNIT131 Internet Basics & Beginning HTML Week 11 – Responsive Web Design http://fog.ccsf.edu/~hyip
  • 2. What is Responsive Web Design? • Responsive web design is about creating web sites which automatically adjust themselves to look good on all devices, from small phones to large desktops. • Bootstrap is the most popular HTML, CSS, and JavaScript framework for developing responsive, mobile-first web sites. • Bootstrap is completely free to download and use!
  • 3. What is Bootstrap? • Bootstrap is a free front-end framework for faster and easier web development • Bootstrap includes HTML and CSS based design templates for typography, forms, buttons, tables, navigation, modals, image carousels and many other, as well as optional JavaScript plugins • Bootstrap also gives you the ability to easily create responsive designs
  • 4. Bootstrap History • Bootstrap was developed by Mark Otto and Jacob Thornton at Twitter, and released as an open source product in August 2011 on GitHub. • Advantages of Bootstrap: • Easy to use: Anybody with just basic knowledge of HTML and CSS can start using Bootstrap • Responsive features: Bootstrap's responsive CSS adjusts to phones, tablets, and desktops • Mobile-first approach: In Bootstrap 3, mobile-first styles are part of the core framework • Browser compatibility: Bootstrap is compatible with all modern browsers (Chrome, Firefox, Internet Explorer, Safari, and Opera)
  • 5. 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.
  • 6. 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.
  • 7. 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>
  • 8. Create Web Page with Bootstrap (2) • Bootstrap is mobile-first • Bootstrap 3 is designed to be responsive to mobile devices. Mobile-first styles are part of the core framework. • To ensure proper rendering and touch zooming, add the following <meta> tag inside the <head> element: <meta name="viewport" content="width=device-width, initial-scale=1"> • The width=device-width part sets the width of the page to follow the screen- width of the device (which will vary depending on the device). • The initial-scale=1 part sets the initial zoom level when the page is first loaded by the browser.
  • 9. Create Web Page with Bootstrap (3) • 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).
  • 10. 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.
  • 11. 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.
  • 12. 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.
  • 13. Three Equal Columns • Three equal columns (desktop version): • Three equal columns (tablet version): • Three equal columns (smart phone version):
  • 14. Two Unequal Columns • Two unequal columns (desktop version): • Two unequal columns (tablet version): • Two unequal columns (smart phone version):
  • 15. 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:
  • 16. 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:
  • 17. 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
  • 18. Bootstrap Button Elements • The button classes can be used on the following elements: • <a> • <button> • <input>
  • 19. Button Sizes • Bootstrap provides four button sizes with the following classes: .btn-lg .btn-md .btn-sm .btn-xs
  • 20. 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:
  • 21. 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:
  • 22. References • Discovering the Internet: Complete, Jennifer Campbell, Course Technology, Cengage Learning, 5th Edition-2015, ISBN 978-1-285- 84540-1. • Basics of Web Design HTML5 & CSS3, Second Edition, by Terry Felke- Morris, Peason, ISBN 978-0-13-312891-8. • W3schools.com