Bs Grids

Bootstrap Grids


Bootstrap Grid System

Bootstrap's grid organisation allows upwardly to 12 columns across the page.
If yous job non wishing to purpose all 12 columns individually, yous tin grouping the columns together to job 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 organisation is responsive, in addition to the columns volition re-arrange automatically depending on the enshroud size.

Grid Classes

The Bootstrap grid organisation has 4 classes:
  • xs (for phones - screens less than 768px wide)
  • sm (for tablets - screens equal to or greater than 768px wide)
  • md (for pocket-size laptops - screens equal to or greater than 992px wide)
  • lg (for laptops in addition to desktops - screens equal to or greater than 1200px wide)
The classes higher upwardly tin live on combined to job to a greater extent than dynamic in addition to flexible layouts.

Basic Structure of a Bootstrap Grid

The next is a basic construction 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; job a row (<div class="row">). Then, add together the desired release of columns (tags amongst appropriate .col-*-* classes). Note that numbers inward .col-*-* should e'er add together upwardly to 12 for each row.
Below nosotros accept collected around examples of basic Bootstrap grid layouts.


Three Equal Columns

.col-sm-4
.col-sm-4
.col-sm-4
The next instance shows how to acquire a iii equal-width columns starting at tablets in addition to scaling to large desktops. On mobile phones or screens that are less than 768px wide, the columns volition automatically stack:

Example

<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

.col-sm-4
.col-sm-8
The next instance shows how to acquire 2 various-width columns starting at tablets in addition to scaling to large desktops:

Example

<div class="row">
  <div class="col-sm-4">.col-sm-4</div>
  <div class="col-sm-8">.col-sm-8</div>
</div>
Tip: You volition acquire to a greater extent than nearly Bootstrap grids after inward this tutorial.

Comments

Popular posts from this blog

What Are The Main Components of a Computer System

Top Qualities To Look For In An IT Support Team

How To Integrate Google Adwords Api Into Codeigniter?