SlideShare a Scribd company logo
Bootstrap Grids
Bootstrap Grid System
 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
span 1 span 1 span 1 span 1 span 1 span 1 span 1 span 1 span 1 span 1 span 1 span 1
span 4 span 4 span 4
span 4 span 8
span 6 span 6
span 12
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 - screens less than 768px wide)
 sm (for tablets - screens equal to or greater than 768px wide)
 md (for small laptops - screens equal to or greater than 992px wide)
 lg (for laptops and desktops - screens equal to or greater than
1200px wide)
The classes above can be combined to create
more dynamic and flexible layouts.
Basic Structure of a Bootstrap Grid
 The following is a basic structure of a Bootstrap
grid:
<div class="row">
<div class="col-*-*"></div>
<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
<div class="row">
<div class="col-sm-4">.col-sm-4</div>
<div class="col-sm-4">.col-sm-4</div>
<div class="col-sm-4">.col-sm-4</div>
</div>
Two Unequal Columns
<div class="row">
<div class="col-sm-4">.col-sm-4</div>
<div class="col-sm-8">.col-sm-8</div>
</div>
Navbar
The navbar is one of the prominent features of Bootstrap
sites. Navbars are responsive 'meta' components that
serve as navigation headers for your application or site.
Navbars collapse in mobile views and become horizontal
as the available viewport width increases. At its core, the
navbar includes styling for site names and basic
navigation.
To create a default navbar
 Add the classes .navbar, .navbar-default to the <nav> tag.
 Add role = "navigation" to the above element, to help with
accessibility.
 Add a header class .navbar-header to the <div> element.
Include an <a> element with class navbar-brand. This will give
the text a slightly larger size.
 To add links to the navbar, simply add an unordered list with the
classes of .nav, .navbar-nav.
 <nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-
brand" href="#">WebSiteName</a>
</div>
<ul class="nav navbar-nav">
<li class="active"><a href="#">Home</a></li>
<li><a href="#">Page 1</a></li>
<li><a href="#">Page 2</a></li>
<li><a href="#">Page 3</a></li>
</ul>
</div>
</nav>
Lecture-10.pptx
Inverted Navigation Bar
 If you don't like the style of the default navigation bar, Bootstrap
provides an alternative, black navbar:
 Just change the .navbar-default class into .navbar-inverse:
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#">WebSiteName</a>
</div>
<ul class="nav navbar-nav">
<li class="active"><a href="#">Home</a></li>
<li><a href="#">Page 1</a></li>
<li><a href="#">Page 2</a></li>
<li><a href="#">Page 3</a></li>
</ul>
</div>
</nav>
Lecture-10.pptx
Navigation Bar With Dropdown
 Navigation bars can also hold dropdown menus.
 The following example adds a dropdown menu for the
"Page 1" button:
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#">WebSiteName</a>
</div>
<ul class="nav navbar-nav">
<li class="active"><a href="#">Home</a></li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">Page 1
<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="#">Page 1-1</a></li>
<li><a href="#">Page 1-2</a></li>
<li><a href="#">Page 1-3</a></li>
</ul>
</li>
<li><a href="#">Page 2</a></li>
<li><a href="#">Page 3</a></li>
</ul>
</div>
</nav>
Right-Aligned Navigation Bar
 The .navbar-right class is used to right-align navigation bar buttons.
 In the following example we insert a "Sign Up" button and a "Login"
button to the right in the navigation bar. We also add a glyphicon on
each of the two new buttons:
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#">WebSiteName</a>
</div>
<ul class="nav navbar-nav">
<li class="active"><a href="#">Home</a></li>
<li><a href="#">Page 1</a></li>
<li><a href="#">Page 2</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="#"><span class="glyphicon glyphicon-user"></span> Sign
Up</a></li>
<li><a href="#"><span class="glyphicon glyphicon-log-
in"></span> Login</a></li>
</ul>
</div>
</nav>
Lecture-10.pptx

More Related Content

PPTX
Intro to Bootstrap
PPTX
bootstrap.pptx
PDF
ViA Bootstrap 4
PPTX
Bootstrap PPT by Mukesh
PPT
Bootstrap 3 training
DOCX
Bootstrap grid system
PPTX
Create Responsive Website Design with Bootstrap 3
PPTX
Bootstrap 3
Intro to Bootstrap
bootstrap.pptx
ViA Bootstrap 4
Bootstrap PPT by Mukesh
Bootstrap 3 training
Bootstrap grid system
Create Responsive Website Design with Bootstrap 3
Bootstrap 3

Similar to Lecture-10.pptx (20)

PDF
Tailwind Navbar A Complete Guide for Stunning User Experience.pdf
PPTX
Bootstrap
PDF
Pemrograman Web 4 - Bootstrap 3
PPTX
Bootstrap Framework
PPTX
Boot strap
PPTX
Material design
PDF
SMACSS Workshop
PPTX
Display Suite: A Themers Perspective
PPTX
An introduction to bootstrap
PPT
Yatish foundation
PDF
Web I - 07 - CSS Frameworks
PPTX
Bootstrap SLIDES for web development course
PDF
Pfnp slides
PDF
CSMess to OOCSS: Refactoring CSS with Object Oriented Design
PPTX
Bootstrap 5 ppt
PPT
Creating Responsive Drupal Sites with Zen Grids and the Zen 5 Theme
PPTX
Bootstrap 3
PPTX
Css responsive
PPTX
ICT Presentjrjdjdjdkkdkeeation Final.pptx
PPTX
Bootstrap - Basics
Tailwind Navbar A Complete Guide for Stunning User Experience.pdf
Bootstrap
Pemrograman Web 4 - Bootstrap 3
Bootstrap Framework
Boot strap
Material design
SMACSS Workshop
Display Suite: A Themers Perspective
An introduction to bootstrap
Yatish foundation
Web I - 07 - CSS Frameworks
Bootstrap SLIDES for web development course
Pfnp slides
CSMess to OOCSS: Refactoring CSS with Object Oriented Design
Bootstrap 5 ppt
Creating Responsive Drupal Sites with Zen Grids and the Zen 5 Theme
Bootstrap 3
Css responsive
ICT Presentjrjdjdjdkkdkeeation Final.pptx
Bootstrap - Basics
Ad

More from vishal choudhary (20)

PPTX
mobile application using automatin using node ja java on
PPTX
mobile development using node js and java
PPTX
Pixel to Percentage conversion Convert left and right padding of a div to per...
PPTX
esponsive web design means that your website (
PPTX
function in php using like three type of function
PPTX
data base connectivity in php using msql database
PPTX
software evelopment life cycle model and example of water fall model
PPTX
software Engineering lecture on development life cycle
PPTX
strings in php how to use different data types in string
PPTX
OPEN SOURCE WEB APPLICATION DEVELOPMENT question
PPTX
web performnace optimization using css minification
PPTX
web performance optimization using style
PPTX
Data types and variables in php for writing and databse
PPTX
Data types and variables in php for writing
PPTX
Data types and variables in php for writing
PPTX
sofwtare standard for test plan it execution
PPTX
Software test policy and test plan in development
PPTX
function in php like control loop and its uses
PPTX
introduction to php and its uses in daily
PPTX
data type in php and its introduction to use
mobile application using automatin using node ja java on
mobile development using node js and java
Pixel to Percentage conversion Convert left and right padding of a div to per...
esponsive web design means that your website (
function in php using like three type of function
data base connectivity in php using msql database
software evelopment life cycle model and example of water fall model
software Engineering lecture on development life cycle
strings in php how to use different data types in string
OPEN SOURCE WEB APPLICATION DEVELOPMENT question
web performnace optimization using css minification
web performance optimization using style
Data types and variables in php for writing and databse
Data types and variables in php for writing
Data types and variables in php for writing
sofwtare standard for test plan it execution
Software test policy and test plan in development
function in php like control loop and its uses
introduction to php and its uses in daily
data type in php and its introduction to use
Ad

Recently uploaded (20)

PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PPTX
Lesson notes of climatology university.
PDF
Sports Quiz easy sports quiz sports quiz
PPTX
Institutional Correction lecture only . . .
PPTX
master seminar digital applications in india
PDF
RMMM.pdf make it easy to upload and study
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PDF
01-Introduction-to-Information-Management.pdf
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
Pre independence Education in Inndia.pdf
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
Insiders guide to clinical Medicine.pdf
Renaissance Architecture: A Journey from Faith to Humanism
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
O5-L3 Freight Transport Ops (International) V1.pdf
Lesson notes of climatology university.
Sports Quiz easy sports quiz sports quiz
Institutional Correction lecture only . . .
master seminar digital applications in india
RMMM.pdf make it easy to upload and study
102 student loan defaulters named and shamed – Is someone you know on the list?
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
01-Introduction-to-Information-Management.pdf
Final Presentation General Medicine 03-08-2024.pptx
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
Supply Chain Operations Speaking Notes -ICLT Program
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Pre independence Education in Inndia.pdf
Microbial diseases, their pathogenesis and prophylaxis
Insiders guide to clinical Medicine.pdf

Lecture-10.pptx

  • 2. Bootstrap Grid System  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 span 1 span 1 span 1 span 1 span 1 span 1 span 1 span 1 span 1 span 1 span 1 span 1 span 4 span 4 span 4 span 4 span 8 span 6 span 6 span 12 Bootstrap's grid system is responsive, and the columns will re-arrange automatically depending on the screen size.
  • 3. Grid Classes The Bootstrap grid system has four classes:  xs (for phones - screens less than 768px wide)  sm (for tablets - screens equal to or greater than 768px wide)  md (for small laptops - screens equal to or greater than 992px wide)  lg (for laptops and desktops - screens equal to or greater than 1200px wide) The classes above can be combined to create more dynamic and flexible layouts.
  • 4. Basic Structure of a Bootstrap Grid  The following is a basic structure of a Bootstrap grid: <div class="row"> <div class="col-*-*"></div> <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.
  • 5. Three Equal Columns <div class="row"> <div class="col-sm-4">.col-sm-4</div> <div class="col-sm-4">.col-sm-4</div> <div class="col-sm-4">.col-sm-4</div> </div>
  • 6. Two Unequal Columns <div class="row"> <div class="col-sm-4">.col-sm-4</div> <div class="col-sm-8">.col-sm-8</div> </div>
  • 7. Navbar The navbar is one of the prominent features of Bootstrap sites. Navbars are responsive 'meta' components that serve as navigation headers for your application or site. Navbars collapse in mobile views and become horizontal as the available viewport width increases. At its core, the navbar includes styling for site names and basic navigation.
  • 8. To create a default navbar  Add the classes .navbar, .navbar-default to the <nav> tag.  Add role = "navigation" to the above element, to help with accessibility.  Add a header class .navbar-header to the <div> element. Include an <a> element with class navbar-brand. This will give the text a slightly larger size.  To add links to the navbar, simply add an unordered list with the classes of .nav, .navbar-nav.
  • 9.  <nav class="navbar navbar-default"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar- brand" href="#">WebSiteName</a> </div> <ul class="nav navbar-nav"> <li class="active"><a href="#">Home</a></li> <li><a href="#">Page 1</a></li> <li><a href="#">Page 2</a></li> <li><a href="#">Page 3</a></li> </ul> </div> </nav>
  • 11. Inverted Navigation Bar  If you don't like the style of the default navigation bar, Bootstrap provides an alternative, black navbar:  Just change the .navbar-default class into .navbar-inverse: <nav class="navbar navbar-inverse"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="#">WebSiteName</a> </div> <ul class="nav navbar-nav"> <li class="active"><a href="#">Home</a></li> <li><a href="#">Page 1</a></li> <li><a href="#">Page 2</a></li> <li><a href="#">Page 3</a></li> </ul> </div> </nav>
  • 13. Navigation Bar With Dropdown  Navigation bars can also hold dropdown menus.  The following example adds a dropdown menu for the "Page 1" button: <nav class="navbar navbar-inverse"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="#">WebSiteName</a> </div> <ul class="nav navbar-nav"> <li class="active"><a href="#">Home</a></li> <li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#">Page 1 <span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#">Page 1-1</a></li> <li><a href="#">Page 1-2</a></li> <li><a href="#">Page 1-3</a></li> </ul> </li> <li><a href="#">Page 2</a></li> <li><a href="#">Page 3</a></li> </ul> </div> </nav>
  • 14. Right-Aligned Navigation Bar  The .navbar-right class is used to right-align navigation bar buttons.  In the following example we insert a "Sign Up" button and a "Login" button to the right in the navigation bar. We also add a glyphicon on each of the two new buttons: <nav class="navbar navbar-inverse"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="#">WebSiteName</a> </div> <ul class="nav navbar-nav"> <li class="active"><a href="#">Home</a></li> <li><a href="#">Page 1</a></li> <li><a href="#">Page 2</a></li> </ul> <ul class="nav navbar-nav navbar-right"> <li><a href="#"><span class="glyphicon glyphicon-user"></span> Sign Up</a></li> <li><a href="#"><span class="glyphicon glyphicon-log- in"></span> Login</a></li> </ul> </div> </nav>