Add a caption text inside a thumbnail class


To add a caption text in a thumbnail class, use the .caption class with the .thumbnail class in Bootstrap.

The .thumbnail class is used to add thumbnail to an image −

Example

Live Demo

<!DOCTYPE html>
<html>
   <head>
      <title>Bootstrap Example</title>
      <link href = "/bootstrap/css/bootstrap.min.css" rel = "stylesheet">
      <script src = "/scripts/jquery.min.js"></script>
      <script src = "/bootstrap/js/bootstrap.min.js"></script>
   </head>
   <body>
      <div class = "container">
         <div class = "row">
            <div class = "col-md-4">
               <div class = "thumbnail">
                  <a href = "https://www.tutorialspoint.com/python/images/python-data-science-mini-logo.jpg" target = "_blank">
                     <img src = "https://www.tutorialspoint.com/python/images/python-data-science-mini-logo.jpg" alt = "Lights" style = "width:100%">
                     <div class="caption">
                        <p>Data science is the process of deriving knowledge and insights from a huge and diverse set of data through organizing, processing and analysing the data. </p>
                     </div>
                  </a>
               </div>
            </div>
         </div>
      </div>
   </body>
</html>

Updated on: 12-Jun-2020

298 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements