在缩略图类中添加一个标题文本


要在缩略图类中添加一个标题文本,在 Bootstrap 中,将 .caption 类与 .thumbnail 类一起使用。

.thumbnail 类用于向图像添加缩略图−

示例

真实演示

<!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://tutorialspoint.com/python/images/python-data-science-mini-logo.jpg" target = "_blank">
                     <img src = "https://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>

更新于: 12-06-2020

357 次浏览

开启您的 事业

通过完成课程获得认证

开始学习
广告