Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap container boxes

Twitter Bootstrap Scaffolding section on Fluid layout shows example code which displays as two blue boxes. Using that example, the code below, displays "Sidebar content Body content" but no boxes. What else is needed?

<!DOCTYPE html>
<html>
<head>
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.no-iconhttp://twitter.github.io/bootstrap/scaffolding.htmls.min.css" rel="stylesheet">
</head>
<body>
<div class="container-fluid">
  <div class="row-fluid">
    <div class="span2">
      Sidebar content
    </div>
    <div class="span10">
      Body content
    </div>
  </div>
</div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/js/bootstrap.min.js"></script>
</body>
</html>
like image 343
CW Holeman II Avatar asked Jul 20 '13 22:07

CW Holeman II


2 Answers

If you're trying to see the blue boxes those are just displayed there for reference and to point out how the grid is divided. They are not actually meant to be included in the code. The words Sidebar Content and Body Content are your reference points for where content will be displayed. In order to get some shading you will need to add a CSS class beside your span2 and span10 divs. Here's an example:

<div class="span2 well">
  Sidebar content
</div>
like image 152
James Giroux Avatar answered Nov 15 '22 07:11

James Giroux


The Bootstrap docs have an additional style property show-grid that is used to display a background (boxes) on the span* (columns) inside of rows. The CSS looks like this:

.show-grid [class*="span"] {
    background-color: #ddd;
}

and is applied to the rows in the docs like this..

<div class="row-fluid show-grid">
    <div class="span2">
      Sidebar content
    </div>
    <div class="span10">
      Body content
    </div>
</div>

Demo: http://www.bootply.com/68856

like image 21
Zim Avatar answered Nov 15 '22 07:11

Zim