Bootstrap Tutorial - Responsive grid layout








The following code shows how to responsive grid layout.

Example

<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet"
  href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<link rel="stylesheet"
  href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.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>
<!--from w w  w .j a v a  2 s. co m-->
</head>
  <body>

    <div class="container">
      <div class="row">
          <div class="col-xs-12 col-sm-6 col1">
              <h4>Column 1</h4>
          </div>
          <div class="col-xs-12 col-sm-6 col2">
              <h4>Column 2</h4>
          </div>
      </div>
      <div class="row">
          <div class="col-xs-12 col-sm-6 col3">
              <h4>Column 3</h4>
          </div>
          <div class="col-xs-12 col-sm-6 col4">
              <h4>Column 4</h4>
          </div>
      </div>
  </div>
  </body>
</html>

Click to view the demo