在缩略图类中添加标题文本
若要缩略图类中添加标题文本,请将带有 .thumbnail 类名的 .caption 类与 Bootstrap 中的 .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>
广告