Bootstrap's thumbnails are used to show linked images in grids with very minimum required markup, a thumbnail is created using class .thumbnail within the element <a>, The column grids are created using class .col-sm-*
and .col-md-*
, it is used to create grids of the images
<h3>Bootstrap thumbnails</h3>
<div class="row">
<div class="col-sm-6 col-md-3">
<a href="#" class="thumbnail">
<img src="apple.jpg" style="height:100px;" />
</a>
</div>
<div class="col-sm-6 col-md-3">
<a href="#" class="thumbnail">
<img src="mango.png" style="height:100px;" />
</a>
</div>
<div class="col-sm-6 col-md-3">
<a href="#" class="thumbnail">
<img src="gauva.jpg"style="height:100px;" />
</a>
</div>
<div class="col-sm-6 col-md-3">
<a href="#" class="thumbnail">
<img src="pomegranate.jpg"style="height:100px;" />
</a>
</div>
</div>
"col-sm-6"
and "col-md-3"
which creates linked images in that space of the row.<a>
tag with class value thumbnail to define the link of the imageoutput
<h3>Adding content in the Bootstrap thumbnail </h3>
<div class="row">
<div class="col-sm-6 col-md-3">
<div class="thumbnail">
<img src="apple.jpg" style="height:150px;" />
</div>
<div class="caption">
<h3> Am Apple fruit</h3>
<p>Delicious and crunchy apple fruit is one of the popular fruits containing an impressive list of antioxidants and essential nutrients required for good health</p>
<p><a href="#" class="btn btn-success">Open</a></p>
</div>
</div>
<div class="col-sm-6 col-md-3">
<div class="thumbnail">
<img src="gauva.jpg" style="height:150px;" />
</div>
<div class="caption">
<h3>Am guava fruit</h3>
<p>Guavas (singular guava, /'gw??.v?/) are common tropical fruits cultivated and enjoyed in many tropical and subtropical regions. Psidium guajava is a small tree in the Myrtle family</p>
<p><a href="#" class="btn btn-warning">Close</a></p>
</div>
</div>
<div class="col-sm-6 col-md-3">
<div class="thumbnail">
<img src="mango.png" style="height:150px;" />
</div>
<div class="caption">
<h3>Am mango fruit</h3>
<p>Mango fruit (Mangifera indica) is one of the most popular, nutritionally rich tropical fruits with unique flavor, fragrance, taste, and heath promoting qualities</p>
<p><a href="#" class="btn btn-danger">Click</a></p>
</div>
</div>
</div>
row
."col-sm-6 col-md-3"
output