Bootstrap Tutorial - Create fluid grid








The following code shows how to create fluid grid.

Example

<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css"
  href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.min.css">
<style type='text/css'>
.row-fix {<!--  ww  w  .  j av a 2s.c o m-->
  margin-bottom: 20px;
}

.row-fix>[class*="span"] {
  height: 100px;
  background: #f1f1f1;
}

.row-fix .two-col {
  background: none;
}

.two-col>[class*="col"] {
  height: 40px;
  background: #ccc;
}

.two-col>.col1 {
  margin-bottom: 20px;
}
</style>
</head>
<body style='margin:30px'>
  <div class="row row-fix">
    <div class="span5">span5</div>
    <div class="span3">span3</div>
    <div class="span2 two-col">
      <div class="col1">span2</div>
      <div class="col2">span2</div>
    </div>
    <div class="span2">span2</div>
  </div>
  <div class="row row-fix">
    <div class="span6 two-col">
      <div class="col1">span6</div>
      <div class="col2">span6</div>
    </div>
    <div class="span6">span6</div>
  </div>
</body>
</html>

Click to view the demo