row responsive bootstrap code example

Example 1: col offset in bootstrap

.col-md-3 .offset-md-3

Example 2: bootstrap breakpoints

// Small devices (landscape phones, 576px and up)
@media (min-width: 576px) { ... }

// Medium devices (tablets, 768px and up)
@media (min-width: 768px) { ... }

// Large devices (desktops, 992px and up)
@media (min-width: 992px) { ... }

// Extra large devices (large desktops, 1200px and up)
@media (min-width: 1200px) { ... }

Example 3: ordering collumns in bootstrap

<div class="container">
  <div class="row">
    <div class="col">
      First, but unordered
    </div>
    <div class="col order-12">
      Second, but last
    </div>
    <div class="col order-1">
      Third, but first
    </div>
  </div>
</div>

Example 4: row class in bootstrap

/*
In Bootstrap, the "row" class is used mainly to hold columns in it.
Bootstrap divides each row into a grid of 12 virtual columns. 
In the following example, the col-md-6 div will have the width of 6/12 of the "row"s div, meaning 50%. 
The col-md-4 will hold 33.3%, and the col-md-2 will hold the remaining 16.66%.
*/

<div class="row">
    <div class="col-md-6"></div>
    <div class="col-md-4"></div>
    <div class="col-md-2"></div>
</div>

Example 5: Bootstrap 4 Grid

<!-- Control the column width, and how they should appear on different devices -->
<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>

<!-- Or let Bootstrap automatically handle the layout -->
<div class="row">
  <div class="col"></div>
  <div class="col"></div>
  <div class="col"></div>
</div>

Tags:

Misc Example