Default thumbnails
By default, Bootstrap's thumbnails are designed to showcase linked images with minimal required markup.
Highly customizable
With a bit of extra markup, it's possible to add any kind of HTML content like headings, paragraphs, or buttons into thumbnails.
-
Thumbnail label
Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus.
Action Action
-
Thumbnail label
Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus.
Action Action
-
Thumbnail label
Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus.
Action Action
Why use thumbnails
Thumbnails (previously .media-grid
up until v1.4) are great for grids of photos or videos, image search results, retail products, portfolios, and much more. They can be links or static content.
Simple, flexible markup
Thumbnail markup is simple—a ul
with any number of li
elements is all that is required. It's also super flexible, allowing for any type of content with just a bit more markup to wrap your contents.
Uses grid column sizes
Lastly, the thumbnails component uses existing grid system classes—like .col-md-2
or .col-md-3
—for control of thumbnail dimensions.
Markup
As mentioned previously, the required markup for thumbnails is light and straightforward. Here's a look at the default setup for linked images:
<ul class="thumbnails"> <li class="col-md-4"> <a href="#" class="thumbnail"> <img data-src="/portals/2/holder.js/300x200" alt=""> </a> </li> ...</ul>
For custom HTML content in thumbnails, the markup changes slightly. To allow block level content anywhere, we swap the <a>
for a <div>
like so:
<ul class="thumbnails"> <li class="col-md-4"> <div class="thumbnail"> <img data-src="/portals/2/holder.js/300x200" alt=""> <h3>Thumbnail label</h3> <p>Thumbnail caption...</p> </div> </li> ...</ul>