Creating Multi-Column Layouts with Bootstrap 3 Grid System - HTML CSS Bootstrap

HTML CSS examples for Bootstrap:Grid Layout

Description

Creating Multi-Column Layouts with Bootstrap 3 Grid System

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
 <head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Example of Bootstrap 3 Multi-Column Grid Layout for All Devices</title>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
  <style type="text/css">
    p{<!--from ww  w  . ja  va2 s .  c o m-->
        padding: 50px;
        font-size: 32px;
        font-weight: bold;
        text-align: center;
        background: #dbdfe5;
    }
</style>
 </head>
 <body>
  <!-- Open the output in a new blank tab (Click the arrow next to "Show Output" button) and resize the window to understand how the Bootstrap responsive grid system works. -->
  <div class="container">
   <div class="row">
    <div class="col-sm-6 col-md-4 col-lg-3">
     <p>Box 1</p>
    </div>
    <div class="col-sm-6 col-md-4 col-lg-3">
     <p>Box 2</p>
    </div>
    <div class="clearfix visible-sm-block"></div>
    <div class="col-sm-6 col-md-4 col-lg-3">
     <p>Box 3</p>
    </div>
    <div class="clearfix visible-md-block"></div>
    <div class="col-sm-6 col-md-4 col-lg-3">
     <p>Box 4</p>
    </div>
    <div class="clearfix visible-sm-block"></div>
    <div class="clearfix visible-lg-block"></div>
    <div class="col-sm-6 col-md-4 col-lg-3">
     <p>Box 5</p>
    </div>
    <div class="col-sm-6 col-md-4 col-lg-3">
     <p>Box 6</p>
    </div>
    <div class="clearfix visible-sm-block"></div>
    <div class="clearfix visible-md-block"></div>
    <div class="col-sm-6 col-md-4 col-lg-3">
     <p>Box 7</p>
    </div>
    <div class="col-sm-6 col-md-4 col-lg-3">
     <p>Box 8</p>
    </div>
    <div class="clearfix visible-sm-block"></div>
    <div class="clearfix visible-lg-block"></div>
    <div class="col-sm-6 col-md-4 col-lg-3">
     <p>Box 9</p>
    </div>
    <div class="clearfix visible-md-block"></div>
    <div class="col-sm-6 col-md-4 col-lg-3">
     <p>Box 10</p>
    </div>
    <div class="clearfix visible-sm-block"></div>
    <div class="col-sm-6 col-md-4 col-lg-3">
     <p>Box 11</p>
    </div>
    <div class="col-sm-6 col-md-4 col-lg-3">
     <p>Box 12</p>
    </div>
   </div>
  </div>
 </body>
</html>

Related Tutorials