下面的實例演示了默認的縮略圖:css
<!DOCTYPE html> <html> <head> <title>Bootstrap 實例 - 縮略圖</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="row"> <div class="col-sm-6 col-md-3"> <a href="#" class="thumbnail"> <img src="/wp-content/uploads/2014/06/kittens.jpg" alt="通用的佔位符縮略圖"> </a> </div> <div class="col-sm-6 col-md-3"> <a href="#" class="thumbnail"> <img src="/wp-content/uploads/2014/06/kittens.jpg" alt="通用的佔位符縮略圖"> </a> </div> <div class="col-sm-6 col-md-3"> <a href="#" class="thumbnail"> <img src="/wp-content/uploads/2014/06/kittens.jpg" alt="通用的佔位符縮略圖"> </a> </div> <div class="col-sm-6 col-md-3"> <a href="#" class="thumbnail"> <img src="/wp-content/uploads/2014/06/kittens.jpg" alt="通用的佔位符縮略圖"> </a> </div> </div> </body> </html>
結果以下所示:html
如今咱們有了一個基本的縮略圖,咱們能夠向縮略圖添加各類 HTML 內容,好比標題、段落或按鈕。具體步驟以下:jquery
下面的實例演示了這點:bootstrap
<!DOCTYPE html> <html> <head> <title>Bootstrap 實例 - 自定義縮略圖</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="row"> <div class="col-sm-6 col-md-3"> <div class="thumbnail"> <img src="/wp-content/uploads/2014/06/kittens.jpg" alt="通用的佔位符縮略圖"> </div> <div class="caption"> <h3>縮略圖標籤</h3> <p>一些示例文本。一些示例文本。</p> <p> <a href="#" class="btn btn-primary" role="button"> 按鈕 </a> <a href="#" class="btn btn-default" role="button"> 按鈕 </a> </p> </div> </div> <div class="col-sm-6 col-md-3"> <div class="thumbnail"> <img src="/wp-content/uploads/2014/06/kittens.jpg" alt="通用的佔位符縮略圖"> </div> <div class="caption"> <h3>縮略圖標籤</h3> <p>一些示例文本。一些示例文本。</p> <p> <a href="#" class="btn btn-primary" role="button"> 按鈕 </a> <a href="#" class="btn btn-default" role="button"> 按鈕 </a> </p> </div> </div> <div class="col-sm-6 col-md-3"> <div class="thumbnail"> <img src="/wp-content/uploads/2014/06/kittens.jpg" alt="通用的佔位符縮略圖"> </div> <div class="caption"> <h3>縮略圖標籤</h3> <p>一些示例文本。一些示例文本。</p> <p> <a href="#" class="btn btn-primary" role="button"> 按鈕 </a> <a href="#" class="btn btn-default" role="button"> 按鈕 </a> </p> </div> </div> <div class="col-sm-6 col-md-3"> <div class="thumbnail"> <img src="/wp-content/uploads/2014/06/kittens.jpg" alt="通用的佔位符縮略圖"> </div> <div class="caption"> <h3>縮略圖標籤</h3> <p>一些示例文本。一些示例文本。</p> <p> <a href="#" class="btn btn-primary" role="button"> 按鈕 </a> <a href="#" class="btn btn-default" role="button"> 按鈕 </a> </p> </div> </div> </div> </body> </html>
結果以下所示:網絡