Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Bootstrap Thumbnails

Bootstrap Thumbnails

This chapter explains Bootstrap thumbnails. Most sites need to lay out images, videos, text, etc. in a grid. Bootstrap provides an easy way to do this with thumbnails. The steps to create a thumbnail with Bootstrap are as follows:

The following example demonstrates the default thumbnail:

Example

<div class="row">
<div class=">

col-sm-6 col-md-3

"

<a href="" class="thumbnail">
<img src="/wp-content/uploads/2014/06/kittens.jpg" alt=">

Generic placeholder thumbnail

"

a

div

<div class=">

col-sm-6 col-md-3

"

<a href="" class="thumbnail">
<img src="/wp-content/uploads/2014/06/kittens.jpg" alt=">

Generic placeholder thumbnail

"

a

div

<div class=">

col-sm-6 col-md-3

"

<a href="" class="thumbnail">
<img src="/wp-content/uploads/2014/06/kittens.jpg" alt=">

Generic placeholder thumbnail

"

a

div

<div class=">

col-sm-6 col-md-3

"

<a href="" class="thumbnail">
<img src="/wp-content/uploads/2014/06/kittens.jpg" alt=">

Generic placeholder thumbnail

"

a

div

div

Try it »

The result is as follows:

Adding custom content

Now that we have a basic thumbnail, we can add various HTML content to it, such as headings, paragraphs, or buttons. The specific steps are as follows:

The following example demonstrates this:

Example

<div class="row">
<div class=">

col-sm-6 col-md-3

"

<div class="thumbnail">
<img src="/wp-content/uploads/2014/06/kittens.jpg" alt=">

Generic placeholder thumbnail

"

<div class="caption">
<h3>

Thumbnail label

h3

<

p

Some example text. Some example text.

p

<p>
<a href="" class=">

btn btn-primary

"

role

=

"

button

"

button

a

<a href="" class=">

btn btn-default

"

role

=

"

button

"

button

a

p

div

div

div

<div class=">

col-sm-6 col-md-3

"

<div class="thumbnail">
<img src="/wp-content/uploads/2014/06/kittens.jpg" alt=">

Generic placeholder thumbnail

"

<div class="caption">
<h3>

Thumbnail label

h3

<

p

Some example text. Some example text.

p

<p>
<a href="" class=">

btn btn-primary

"

role

=

"

button

"

button

a

<a href="" class=">

btn btn-default

"

role

=

"

button

"

button

a

p

div

div

div

<div class=">

col-sm-6 col-md-3

"

<div class="thumbnail">
<img src="/wp-content/uploads/2014/06/kittens.jpg" alt=">

Generic placeholder thumbnail

"

<div class="caption">
<h3>

Thumbnail label

h3

<

p

Some example text. Some example text.

p

<p>
<a href="" class=">

btn btn-primary

"

role

=

"

button

"

button

a

<a href="" class=">

btn btn-default

"

role

=

"

button

"

button

a

p

div

div

div

<div class=">

col-sm-6 col-md-3

"

<div class="thumbnail">
<img src="/wp-content/uploads/2014/06/kittens.jpg" alt=">

Generic placeholder thumbnail

"

<div class="caption">
<h3>

Thumbnail label

h3

<

p

Some example text. Some example text.

p

<p>
<a href="" class=">

btn btn-primary

"

role

=

"

button

"

button

a

<a href="" class=">

btn btn-default

"

role

=

"

button

"

button

a

p

div

div

div

div

Try it »

The result is as follows: