Using Bootstrap Components

Before we start we need to get an idea of the different components available to us. Based on the site sample we viewed earlier we can identify four key areas that we’ll need to build.

screen-cap-components

Content Container

The Content Container is a structural element required by Bootstrap to maintain document dimensions. We’ll add one to our code below the close of the Navbar section. Be sure to place the other components inside of this container element.

<div class="container">

     <!--Place other components inside this element -->

</div> <!-- /container -->

After you have added the code, save the document and then Preview in your web Browser (F12 or File > Preview in Browser).

Back to Top

Hero Element

Documentation

A Hero Element is meant to be used as a call to action or a spot to feature a piece of content. The code we’ll use is below.

<!-- Main hero unit for a primary marketing message or call to action -->
      <div class="hero-unit">
        <h1>EAST 2013</h1>
        <p>This is a demo site used to show off the capabilities of Twitter Bootstrap</p>
        <p><a href="http://twitter.github.com/bootstrap/" class="btn btn-inverse">Learn more &raquo;</a></p>
      </div>
      <!-- End Hero Unit -->

After you have added the code, save the document and then Preview in your web Browser (F12 or File > Preview in Browser).

Back to Top

Three Column Grid

Documentation

In order to add a row of grid columns we’ll need to add a div with the class="row" attribute added. Inside we can place up to 12 additional “columns”  by adding a div with a class="spanX" with X being the number of columns we wish to span. For example we’d like 3 equal-sized columns in our mock up so we will add the following code…

<div class="span4">Column 1</div>
<div class="span4">Column 2</div>
<div class="span4">Column 3</div>

To duplicate the demo site we’ll need to use the following code…

 <!-- Example row of columns -  http://twitter.github.com/bootstrap/scaffolding.html#fluidGridSystem-->
      <div class="row">
        <div class="span4">
        <img src="img/team.jpg" alt="Team" class="img-polaroid">
          <h2>The Team</h2>
          <p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, <a href="#" class="tooltip" data-toggle="tooltip" title="This is an example of a tooltip">tortor mauris </a>condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
          <p><a class="btn btn-inverse" href="http://www.jpl.nasa.gov/">View details &raquo;</a></p>
        </div>
        <div class="span4">
        <img src="img/rover.jpg" alt="Rover" class="img-polaroid">
          <h2>The Rover</h2>
          <p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, <a href="#" class="tooltip" data-toggle="tooltip" title="This is an example of a tooltip">tortor mauris </a>condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
          <p><a class="btn btn-inverse" href="http://www.jpl.nasa.gov/">View details &raquo;</a></p>
       </div>
        <div class="span4">
        <img src="img/reentry.jpg" alt="Reentry" class="img-polaroid">
          <h2>Reentry</h2>
          <p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, <a href="#" class="tooltip" data-toggle="tooltip" title="This is an example of a tooltip">tortor mauris </a>condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
          <p><a class="btn btn-inverse" href="http://www.jpl.nasa.gov/">View details &raquo;</a></p>
        </div>
      </div>
      <!-- End Row of Columns -->

After you have added the code, save the document and then Preview in your web Browser (F12 or File > Preview in Browser).

Back to Top