Portal Customization, Part 1: Introduction to Bootstrap and Common Components
This is Part 1 in a multi-part series on customizing a portal using Bootstrap.
Introduction
Today’s end user expects that your website will be usable from a phone, tablet, or PC. Creating and maintaining multiple sites is slow and cumbersome. Enter Bootstrap. Bootstrap is a responsive design framework that provides a suite of functionality to render content based on the size of the browser’s view port (rendering area). By leveraging this framework, you can rapidly create content with a polished look and uniform user experience.
What is Bootstrap?
Bootstrap is a framework built on HTML, CSS and JavaScript. Bootstrap uses CSS and JavaScript to transform plain HTML elements into rich web controls. You can find the full list of components at http://getbootstrap.com/components/.
How it works
Bootstrap defines the view port using a series of columns (by default 12). When a component spills past the final column, it automatically moves down, providing a responsive user experience. To change the number of columns used in page layout, you specify the @grid-columns variable when making a custom build of bootstrap. Look for more on that in the next post.
Overview
For the purpose of this post, we will focus on a handful of components:
Glyphicons
Reference: http://getbootstrap.com/components/#jumbotron
Glyphicons (glyphicons.com) is a font comprised of vector-based images that are commonly used in websites. Content creators add human-readable CSS classes to HTML elements to render the image. This type of implementation has the added benefit of accurately scaling per the user’s zoom level, and per the font-size CSS property.
<span class="glyphicon glyphicon-thumbs-up"/>
<span class="glyphicon glyphicon-thumbs-down"/>
<span class="glyphicon glyphicon-share"/>Share</span>
</div>
Jumbotron
Reference: http://getbootstrap.com/components/#jumbotron
A Jumbotron is a large container that is intended to draw attention to a region of the page.
<h1>Flash Sale!</h1>
<p>Some of our hottest products are on sale, with deep discounts on core bundles.</p>
<p><a class="btn btn-primary btn-lg">See Offers</a></p>
</div>
Panels
If you want to visually box some page content to provide a clear separation, a panel is the perfect component. It has optional header and footer regions as well.
<div class="panel-heading">Panel Heading</div>
<div class="panel-body">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis sed eros justo. Curabitur vestibulum elementum felis, ut bibendum ex scelerisque non. In hendrerit ultrices rhoncus. Sed scelerisque tortor sapien, et auctor diam rhoncus ut. Nam lobortis fermentum metus, nec bibendum ipsum interdum et. Fusce ac sagittis magna. Curabitur ultrices ultrices nulla in ullamcorper. Cras non urna magna. Suspendisse potenti.</p>
</div>
<div class="panel-footer">
<em>Source: <a href="http://www.lipsum.com">www.lipsum.com</a></em>
</div>
</div>
Tabs
Reference: http://getbootstrap.com/components/#nav-tabs
Tabs are useful for collapsing large areas of a page into smaller.
<div class="panel-heading">
<ul class="nav nav-tabs">
<li class="active"><a href="#">Service Requests</a></li>
<li><a href="#">Recent Orders</a></li>
<li><a href="#">Blog Posts</a></li>
<li><a href="#">Forum Posts</a></li>
<li><a href="#">Messages</a></li>
</ul>
</div>
</div>
Labels
Reference: http://getbootstrap.com/components/#labels
Labels provide a clean highlighted appearance and work well to help end users visually correlate content.
<div class="panel-heading">Release Notes</div>
<div class="panel-body">
<ul class="list-group">
<li class="list-group-item">
<h4>2.0.0 <span class="label label-primary">Latest</span></h4>
<span>The long-awaited 2.x release is finally here.</span>
</li>
<li class="list-group-item">
<h4>1.9.5 <span class="label label-info">LTS</span></h4>
<span>This release has entered Long Term Support and will no longer recieve new features - only bugs and security issues will be addressed.</span>
</li>
<li class="list-group-item">
<h4>1.8.0 <span class="label label-warning">Unsupported</span></h4>
<span>Long Term Support for this release is complete, so this version is no longer supported.</span>
</li>
<li class="list-group-item">
<h4>1.5.0 <span class="label label-danger">Unstable</span></h4>
<span>Due to stability issues with the flux capacitor, we recommend that you upgrade immediately.</span>
</li>
</ul>
</div>
</div>
*This post is locked for comments