Bootstrap框架的學(xué)習(xí)教程詳解(二)
Bootstrap,來(lái)自 Twitter,是目前最受歡迎的前端框架。Bootstrap 是基于 HTML、CSS、JAVASCRIPT 的,它簡(jiǎn)潔靈活,使得 Web 開(kāi)發(fā)更加快捷。
一、下載Bootstrap
Bootstrap (當(dāng)前版本 v3.3.0)提供以下幾種方式幫你快速上手,每一種方式針對(duì)具有不同技能等級(jí)的開(kāi)發(fā)者和不同的使用場(chǎng)景。
下載地址:http://v3.bootcss.com/getting-started/#download
PS:其實(shí)我們不用下載bootstrap也可以使用它:
Bootstrap 中文網(wǎng) 為 Bootstrap 專門構(gòu)建了自己的免費(fèi) CDN 加速服務(wù)。基于國(guó)內(nèi)云廠商的 CDN 服務(wù),訪問(wèn)速度更快、加速效果更明顯、沒(méi)有速度和帶寬限制、永久免費(fèi)。
二、預(yù)編譯版
下載壓縮包之后,將其解壓縮到任意目錄即可看到以下(壓縮版的)目錄結(jié)構(gòu):
bootstrap/ ├── css/ │ ├── bootstrap.css │ ├── bootstrap.min.css │ ├── bootstrap-theme.css │ └── bootstrap-theme.min.css ├── js/ │ ├── bootstrap.js │ └── bootstrap.min.js └── fonts/ ├── glyphicons-halflings-regular.eot ├── glyphicons-halflings-regular.svg ├── glyphicons-halflings-regular.ttf └── glyphicons-halflings-regular.woff
PS:字體可以添加也可以不添加
三、實(shí)例一
<html lang="en"> <head> <!--這三個(gè)meta標(biāo)簽必須在head頭三個(gè)--> <!--1、utf8中文--> <meta charset="utf-8"> <!--2、IE瀏覽器的適配--> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <!--3、適配到手機(jī)屏幕--> <meta name="viewport" content="width=device-width, initial-scale=1"> <!--title題目--> <title>First Template for Bootstrap</title> <!-- 新 Bootstrap 核心 CSS 文件 --> <link href="css/bootstrap.min.css" rel="stylesheet"> </head> <body> <!--導(dǎo)航條,nav標(biāo)簽--> <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation"> <ul class="nav navbar-nav"> <!--導(dǎo)航條內(nèi)容--> <li class="active"><a href="home.html">首頁(yè) <span class="sr-only">(current)</span></a></li> <li><a href="Java.html">JAVA</a></li> <li><a href="#">HTML</a></li> <li><a href="#">PS</a></li> </div> </nav> <!-- Bootstrap core JavaScript ================================================== --> <!-- Placed at the end of the document so the pages load faster --> <script src="js/jquery.min.js"></script> <!-- Bootstrap核心js依賴于jQuery,所以要先引用jQuery--> <!-- Include all compiled plugins (below), or include individual files as needed --> <!-- 最新的 Bootstrap 核心 JavaScript 文件 --> <script src="js/bootstrap.min.js"></script> </body></html>
運(yùn)行截圖如下圖所示:
四、實(shí)例二
柵格系統(tǒng)是Bootstrap的和具有優(yōu)勢(shì)。采用的是流式的柵格系統(tǒng),對(duì)寬度進(jìn)行12等分。
<!--柵格系統(tǒng), 全局CSS樣式-柵格系統(tǒng) --> <!--柵格系統(tǒng)放在container容器中--> <div class="container" style="margin-top: 60px"> <!--添加一行占用12列,添加img--> <div class="row"> <!--javascript插件,添加carousel輪播圖--> <div id="carousel-example-generic" class="carousel slide" data-ride="carousel" > <!-- Indicators --> <ol class="carousel-indicators"> <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li> <li data-target="#carousel-example-generic" data-slide-to="1"></li> <li data-target="#carousel-example-generic" data-slide-to="2"></li> <li data-target="#carousel-example-generic" data-slide-to="3"></li> </ol> <!-- Wrapper for slides --> <div class="carousel-inner" role="listbox"> <div class="item active"> <img src="img/sliders/pic1.png" /> <div class="carousel-caption"> <h3>College Team</h3> </div> </div> <div class="item"> <img src="img/sliders/pic2.jpg" /> <div class="carousel-caption"> <h3>College Life</h3> </div> </div> <div class="item"> <img src="img/sliders/pic3.png" /> <div class="carousel-caption"> <h3>Country Project</h3> </div> </div> <div class="item"> <img src="img/sliders/pic3_3.jpg" /> <div class="carousel-caption"> <h3>Hello World</h3> </div> </div> </div> <!-- Controls --> <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev"> <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span> <span class="sr-only">Previous</span> </a> <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next"> <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span> <span class="sr-only">Next</span> </a> </div> </div> <!--頁(yè)面分為左右兩部分 4:8--> <div class="row" style="margin-top: 10px"> <div class="col-sm-4"> <!--添加列表組件--> <div class="list-group" style="margin-bottom:0"> <a href="#" class="list-group-item active">看看>看看</a> <a href="Project_exp.html" class="list-group-item">看看</a> <a href="#" class="list-group-item">看看</a> <a href="#" class="list-group-item">看看</a> <a href="#" class="list-group-item">看看</a> <a href="#" class="list-group-item">看看</a> </div> <!--<div> <img src="img/class.gif"> </div>--> </div> <div class="col-sm-8"> <!--first--> <table id="first" class="table table-bordered table-striped table-hover table-condensed"> <tr class="active"> <td>看看</td> </tr> <tr class="success"> <td>看看</td> </tr> <tr class="warning"> <td>看看</td> </tr> <tr class="danger"> <td>看看</td> </tr> <tr class="info"> <td>看看</td> </tr> <tr class="active"> <td>看看</td> </tr> <tr class="success"> <td>看看</td> </tr> <tr class="danger"> <td>個(gè)人主頁(yè)(博客園):<a target="_blank">https://home.cnblogs.com/u/chengxs/</a></td> </tr> <tr class="info"> <td>看看</td> </tr> <tr class="success"> <td>看看</td> </tr> <tr class="danger"> <td>看看。</td> </tr> </table> <!-- 添加分頁(yè)效果--> <nav> <ul class="pagination" style="margin: 0px 0px"> <li> <a href="#" aria-label="Previous"> <span aria-hidden="true">«</span> </a> </li> <li class="active"><a href="#first">1</a></li> <li><a href="#second">2</a></li> <li><a href="#">3</a></li> <li><a href="#">4</a></li> <li><a href="#">5</a></li> <li> <a href="#" aria-label="Next"> <span aria-hidden="true">»</span> </a> </li> </ul> </nav> </div> </div> </div>
效果如圖所示
以上所述是小編給大家介紹的Bootstrap框架的學(xué)習(xí)教程詳解(二),希望對(duì)大家有所幫助,如果大家有任何疑問(wèn)請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!
相關(guān)文章
js實(shí)現(xiàn)開(kāi)關(guān)燈效果
這篇文章主要為大家詳細(xì)介紹了js實(shí)現(xiàn)開(kāi)關(guān)燈效果,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2019-10-10基于javascript實(shí)現(xiàn)判斷移動(dòng)終端瀏覽器版本信息
這篇文章主要介紹了基于javascript實(shí)現(xiàn)判斷移動(dòng)終端瀏覽器版本信息,需要的朋友可以參考下2014-12-12javascirpt實(shí)現(xiàn)2個(gè)iframe之間傳值的方法
這篇文章主要介紹了javascirpt實(shí)現(xiàn)2個(gè)iframe之間傳值的方法,涉及javascript針對(duì)iframe框架下的頁(yè)面元素操作技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下2016-06-06微信小程序使用request網(wǎng)絡(luò)請(qǐng)求操作實(shí)例
這篇文章主要介紹了微信小程序使用request網(wǎng)絡(luò)請(qǐng)求操作,結(jié)合實(shí)例形式分析了wx.request(object)網(wǎng)絡(luò)請(qǐng)求操作的具體使用技巧,需要的朋友可以參考下2017-12-12關(guān)于微信小程序中使用wx.getLocation獲取當(dāng)前詳細(xì)位置并計(jì)算距離
這篇文章主要介紹了關(guān)于微信小程序中使用wx.getLocation獲取當(dāng)前詳細(xì)位置并計(jì)算距離,wx.getLocation只能夠獲取經(jīng)緯度,不能夠拿到詳細(xì)地址,這里使用騰訊地圖的api,需要的朋友可以參考下2023-04-04Bootstrap模態(tài)對(duì)話框中顯示動(dòng)態(tài)內(nèi)容的方法
今天小編就為大家分享一篇Bootstrap模態(tài)對(duì)話框中顯示動(dòng)態(tài)內(nèi)容的方法,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧2018-08-08