Bootstrap縮略圖的創(chuàng)建方法
Bootstrap 創(chuàng)建縮略圖的步驟如下:
1、在圖像周圍添加帶有 class .thumbnail 的 <a> 標(biāo)簽.
2、這會(huì)添加四個(gè)像素的內(nèi)邊距(padding)和一個(gè)灰色的邊框。
有了一個(gè)基本的縮略圖,我們可以向縮略圖添加各種 HTML 內(nèi)容,比如標(biāo)題、段落或按鈕。具體步驟如下:
1、把帶有 class .thumbnail 的 <a> 標(biāo)簽改為 <div>。
2、在該 <div> 內(nèi),您可以添加任何您想要添加的東西。由于這是一個(gè) <div>,我們可以使用默認(rèn)的基于 span 的命名規(guī)則來調(diào)整大小。
html代碼
<!DOCTYPE html> <html> <head> <title>Bootstrap 頁面標(biāo)題(Page Header)</title> <meta charset="utf-8"> <link rel="stylesheet" href="css/bootstrap.min.css" rel="external nofollow" > <style> h2{ color: #080808; font-weight:900; text-shadow:1px 1px 0px #AD55C9; } p{ color: #6A031A; size: 24px; } </style> </head> <body> <div class="row"> <div class="col-sm-6 col-md-3"> <div class="thumbnail"><img src="img/2.jpg"></div> <div class="caption"> <h2>漂亮的圖片</h2> <p>漂亮的圖片.漂亮的圖片.</p> <p><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" class="btn btn-primary" role="button">點(diǎn)你 </a> <a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" class="btn btn-default" role="button">就點(diǎn)你 </a> </p> </div> </div> <div class="col-sm-6 col-md-3"> <div class="thumbnail"><img src="img/2.jpg"></div> <div class="caption"> <h2>漂亮的圖片</h2> <p>漂亮的圖片.漂亮的圖片.</p> <p><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" class="btn btn-primary" role="button">點(diǎn)你 </a> <a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" class="btn btn-default" role="button">就點(diǎn)你 </a> </p> </div> </div> <div class="col-sm-6 col-md-3"> <div class="thumbnail"><img src="img/2.jpg"></div> <div class="caption"> <h2>漂亮的圖片</h2> <p>漂亮的圖片.漂亮的圖片.</p> <p><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" class="btn btn-primary" role="button">點(diǎn)你 </a> <a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" class="btn btn-default" role="button">就點(diǎn)你 </a> </p> </div> </div> <div class="col-sm-6 col-md-3"> <div class="thumbnail"><img src="img/2.jpg"></div> <div class="caption"> <h2>漂亮的圖片</h2> <p>漂亮的圖片.漂亮的圖片.</p> <p><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" class="btn btn-primary" role="button">點(diǎn)你 </a> <a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" class="btn btn-default" role="button">就點(diǎn)你 </a> </p> </div> </div> <div class="col-sm-6 col-md-3"> <div class="thumbnail"><img src="img/2.jpg"></div> <div class="caption"> <h2>漂亮的圖片</h2> <p>漂亮的圖片.漂亮的圖片.</p> <p><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" class="btn btn-primary" role="button">點(diǎn)你 </a> <a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" class="btn btn-default" role="button">就點(diǎn)你 </a> </p> </div> </div><div class="col-sm-6 col-md-3"> <div class="thumbnail"><img src="img/2.jpg"></div> <div class="caption"> <h2>漂亮的圖片</h2> <p>漂亮的圖片.漂亮的圖片.</p> <p><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" class="btn btn-primary" role="button">點(diǎn)你 </a> <a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" class="btn btn-default" role="button">就點(diǎn)你 </a> </p> </div> </div><div class="col-sm-6 col-md-3"> <div class="thumbnail"><img src="img/2.jpg"></div> <div class="caption"> <h2>漂亮的圖片</h2> <p>漂亮的圖片.漂亮的圖片.</p> <p><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" class="btn btn-primary" role="button">點(diǎn)你 </a> <a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" class="btn btn-default" role="button">就點(diǎn)你 </a> </p> </div> </div><div class="col-sm-6 col-md-3"> <div class="thumbnail"><img src="img/2.jpg"></div> <div class="caption"> <h2>漂亮的圖片</h2> <p>漂亮的圖片.漂亮的圖片.</p> <p><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" class="btn btn-primary" role="button">點(diǎn)你 </a> <a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" class="btn btn-default" role="button">就點(diǎn)你 </a> </p> </div> </div> </div> <script src="js/jquery.min.js"></script> <script src="js/bootstrap.min.js"></script> </body> </html>
效果圖
以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
相關(guān)文章
十個(gè)開發(fā)人員面臨的最常見的JavaScript問題總結(jié)
今天,JavaScript?是幾乎所有現(xiàn)代?Web?應(yīng)用的核心。這就是為什么JavaScript問題,以及找到導(dǎo)致這些問題的錯(cuò)誤,是?Web?發(fā)者的首要任務(wù)。本文總結(jié)了十個(gè)常見的問題及解決方法,需要的可以參考一下2022-11-11微信小程序自定義組件的實(shí)現(xiàn)方法及自定義組件與頁面間的數(shù)據(jù)傳遞問題
這篇文章主要介紹了微信小程序自定義組件的實(shí)現(xiàn)方法及自定義組件與頁面間的數(shù)據(jù)傳遞 ,需要的朋友可以參考下2018-10-10AjaxUpLoad.js實(shí)現(xiàn)文件上傳功能
這篇文章主要為大家詳細(xì)介紹了AjaxUpLoad.js實(shí)現(xiàn)文件上傳功能,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2018-03-03談?wù)処ntersectionObserver懶加載的具體使用
這篇文章主要介紹了談?wù)処ntersectionObserver懶加載的具體使用,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2019-10-10JavaScript實(shí)現(xiàn)圓形進(jìn)度條效果
這篇文章主要為大家詳細(xì)介紹了JavaScript實(shí)現(xiàn)圓形進(jìn)度條效果,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2021-08-08JavaScript中遞歸實(shí)現(xiàn)的方法及其區(qū)別
遞歸函數(shù)是在通過名字調(diào)用自身的情況下構(gòu)成的。下面通過本文給大家分享JavaScript中遞歸實(shí)現(xiàn)的方法及其區(qū)別,感興趣的朋友一起看看吧2017-09-09JS中字符問題(二進(jìn)制/十進(jìn)制/十六進(jìn)制及ASCII碼之間的轉(zhuǎn)換)
對于js的進(jìn)制轉(zhuǎn)換的一些方法分析2008-11-11setTimeout與setInterval的區(qū)別淺析
這篇文章主要給大家介紹了關(guān)于setTimeout與setInterval區(qū)別的相關(guān)資料,文中通過示例代碼介紹的非常詳細(xì),對大家學(xué)習(xí)或者使用js具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面來一起學(xué)習(xí)學(xué)習(xí)吧2019-03-03Bootstrap3 圖片(響應(yīng)式圖片&圖片形狀)
這篇文章主要介紹了 Bootstrap3 圖片 響應(yīng)式圖片和圖片形狀的相關(guān)資料,需非常不錯(cuò),具有參考借鑒價(jià)值,需要的朋友可以參考下2017-01-01