Responsive Design Features
New Responsive Design
As of May 2015, the VA Internet Template is responsive by design. One of the features of the design is the use of Twitter Bootstrap for layout and other functionality. On this page and the linked pages is a brief overview of the most widely used features.
The Bootstrap Grid
Bootstrap uses a 12-column system for layout. Unfortunately, some of the VA template styles modify the default Bootstrap column widths (col-md-3/9 and col-md-4/8 specifically) and this can cause some frustration. It is recommended that you use col-sm (small for tablets in landscape position) if possible.
col-xs-4
col-xs-4
col-xs-4
col-sm-6
col-sm-6
col-sm-7
col-sm-5
col-sm-4
col-sm-4
col-sm-4
col-sm-3
col-sm-3
col-sm-3
col-sm-3
col-md-2
col-md-2
col-md-2
col-md-2
col-md-2
col-md-2
Bootstrap Grid Code Sample
<div class="row"> <div class="col-sm-6"> <p>col-sm-6</p> </div> <div class="col-sm-6"> <p>col-sm-6</p> </div> </div>
Images
One of the most useful features of Twitter Bootstrap is the ease at making images responsive. All that is required is to add the class img-responsive. That's it. Also, to center an image add the class center-block. The Feature Story example shows additional ways to align images as well as how to use <figure> and <figcaption> tags. Keep in mind that align=left and align=right are deprecated tags in html5 and should NOT be used.
More than any other item images can negatively impact a site visitor's experience. Unless you are providing images for download, images should never be more that 1000 pixels (px) wide at 96 dpi and kept under 200k in size. Having a 4000px wide image at 300 dpi (print quality) and resized in code to 200px wide, does nothing but slow down the page and on mobile networks can make your page useless. In addition to file size, the image should not be enlarged to fit an area and should be cropped to meet the needed size to ensure the visitor sees what you want them to see.
Bullets
Bulleted lists are a known issue with the new template and are being looked at. In the meantime you can use the class feature-list for unordered lists and feature-ol for ordered lists.
Unordered List
- Bullet 1
- Bullet 2
- Bullet 3
<ul class="feature-list"> <li>Bullet 1</li> <li>Bullet 2</li> <li>Bullet 3</li> </ul>
Ordered List
- Bullet 1
- Bullet 1
- Bullet 2
- Bullet 3
- Bullet 2
- Bullet 3
<ol class="feature-ol"> <li>Bullet 1 <ol> <li>Bullet 1</li> <li>Bullet 2</li> <li>Bullet 3</li> </ol> </li> <li>Bullet 2</li> <li>Bullet 3</li> </ol>
Ordered Numeric List
- Bullet 1
- Bullet 1
- Bullet 2
- Bullet 3
- Bullet 2
- Bullet 3
<ol class="feature-ol-numeric"> <li>Bullet 1 <ol> <li>Bullet 1</li> <li>Bullet 2</li> <li>Bullet 3</li> </ol> </li> <li>Bullet 2</li> <li>Bullet 3</li> </ol>
Ordered Alphanumeric List
- Bullet 1
- Bullet 1
- Bullet 2
- Bullet 3
- Bullet 2
- Bullet 3
<ol class="feature-ol-alpha"> <li>Bullet 1 <ol> <li>Bullet 1</li> <li>Bullet 2</li> <li>Bullet 3</li> </ol> </li> <li>Bullet 2</li> <li>Bullet 3</li> </ol>
Blockquotes
Standard Blockquote
<blockquote> Standard Blockquote </blockquote>
Feature story blockquote using class feature-blockquote. Can be used anywhere within health. Stephen Walker
<blockquote class="feature-blockquote"> Feature story blockquote using class feature-blockquote. Can be used anywhere within health. <cite>Stephen Walker</cite> </blockquote>
Panels
Panel content using a modified color and styling. class="panel panel-va-navy"
Also available:
- panel-va-dark-red
- panel-va-dark-blue
- panel-va-lightblue
- panel-va-red
<div class="panel panel-va-navy"> <div class="panel-heading"> <strong>Panel Title</strong> </div> <div class="panel-body"> Panel body text. </div> <div class="panel-footer"> Footer is optional </div> </div>
Panel content using a modified color and styling. class="panel panel-va-dark-red"
Also available:
- panel-va-navy
- panel-va-dark-blue
- panel-va-lightblue
- panel-va-red
List Group
List groups are a nice feature, but some of the styles in the VA template cause problems with the basic list. This one is a div based list and has been updated to use the VA website blue for the header.
Note: This style has been added to the VAMC 2014 Styles and should be available to all VHA sites.
Flat
<div class="va-list-group"> <a href="#" class="va-list-group-item active">List Item #1</a> <a href="#" class="va-list-group-item">List Item #2</a> <a href="#" class="va-list-group-item">List Item #3</a> <a href="#" class="va-list-group-item">List Item #4</a> <a href="#" class="va-list-group-item">List Item #5</a> </div>
Material
<div class="vam-list-group"> <a href="#" class="vam-list-group-item active">List Item #1</a> <a href="#" class="vam-list-group-item">List Item #2</a> <a href="#" class="vam-list-group-item">List Item #3</a> <a href="#" class="vam-list-group-item">List Item #4</a> <a href="#" class="vam-list-group-item">List Item #5</a> </div>
Tables
Bootstrap provides some excellent styling out of the box.
Basic Table
Name | Position |
---|---|
Angelica Ramos | Chief Executive Officer (CEO) |
Bradley Greer | Software Engineer |
Bruno Nash | Software Engineer |
Haley Kennedy | Senior Marketing Designer |
Bordered Table
Name | Position |
---|---|
Angelica Ramos | Chief Executive Officer (CEO) |
Bradley Greer | Software Engineer |
Bruno Nash | Software Engineer |
Haley Kennedy | Senior Marketing Designer |
Border with Striping
Name | Position |
---|---|
Angelica Ramos | Chief Executive Officer (CEO) |
Bradley Greer | Software Engineer |
Bruno Nash | Software Engineer |
Haley Kennedy | Senior Marketing Designer |
Border with Striping and Hover Feature
Name | Position |
---|---|
Angelica Ramos | Chief Executive Officer (CEO) |
Bradley Greer | Software Engineer |
Bruno Nash | Software Engineer |
Haley Kennedy | Senior Marketing Designer |
Condensed (reduced padding), Border, Striping, and Hover
Name | Position |
---|---|
Angelica Ramos | Chief Executive Officer (CEO) |
Bradley Greer | Software Engineer |
Bruno Nash | Software Engineer |
Haley Kennedy | Senior Marketing Designer |
<table class="table table-condensed table-bordered table-striped table-hover"> <caption class="table-caption">This is a table caption</caption> <thead> <tr> <th scope="col">Name</th> <th scope="col">Position</th> </tr> </thead> <tbody> <tr> <td>text</td> <td>text</td> </tr> </tbody> </table>
Table style created by Chris Desrocher (class="data")
Name | Position |
---|---|
Angelica Ramos | Chief Executive Officer (CEO) |
Bradley Greer | Software Engineer |
Bruno Nash | Software Engineer |
Haley Kennedy | Senior Marketing Designer |
Hermione Butler | Regional Director |
Jena Gaines | Office Manager |
Lael Greer | Systems Administrator |
Michael Silva | Marketing Designer |
Prescott Bartlett | Technical Author |
Suki Burks | Developer |