Thumbnails Grids of images, videos, text, and more
By default, Bootstrap's thumbnails are designed to showcase linked images with minimal required markup.
With a bit of extra markup, it's possible to add any kind of HTML content like headings, paragraphs, or buttons into thumbnails.
Why use thumbnails
.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
.span3—for control of thumbnail dimensions.
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="span4"> <a href="#" class="thumbnail"> <img src="http://placehold.it/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="span4"> <div class="thumbnail"> <img src="http://placehold.it/300x200" alt=""> <h3>Thumbnail label</h3> <p>Thumbnail caption...</p> </div> </li> ... </ul>
Explore all your options with the various grid classes available to you. You can also mix and match different sizes.