1.進入官網下載相應版本bootstrap:http://www.bootcss.com/
本 次下載3.3.5版本:http://v3.bootcss.com/ 點「下載bootstrap」:
下載完畢,將bootstrap解壓到你項目,你想要放置的地方。
css
2.在html文件裏面引入相應的bootstrap:html
2.1 在網站:http://v3.bootcss.com/getting-started/#download 有作詳細的說明和教程:
2.2 下面就簡單說說:
1) 引入三個meta文件,放在head標籤的頂部。jquery
2) 再是引入bootstrap的css文件:
web
3) body標籤底部引入兩個js文件:1. jQuery文件,必須在bootstrap的js文件的前面;2.bootstrap的js文件。
bootstrap
Tip: 如果直接在官網上覆制的模板,請不要忘記改css和js文件引入的路徑。網站
實例:使用bootstrap的模態框:ui
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- 上述3個meta標籤*必須*放在最前面,任何其餘內容都*必須*跟隨其後! --> <title>Title</title> <!-- Bootstrap --> <link href="../Public/bootstrap-3.3.5-dist/css/bootstrap.min.css" rel="stylesheet"> </head> <body> <!-- Button trigger modal --> <button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal"> Launch demo modal </button> <!-- Modal --> <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> <h4 class="modal-title" id="myModalLabel">Modal title</h4> </div> <div class="modal-body"> ... </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> <button type="button" class="btn btn-primary">Save changes</button> </div> </div> </div> </div> <!-- jQuery (necessary for Bootstrap's JavaScript plugins) --> <script src="//cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script> <!-- Include all compiled plugins (below), or include individual files as needed --> <script src="../Public/bootstrap-3.3.5-dist/js/bootstrap.min.js"></script> </body> </html>
演示頁面:http://issac.website/myfunc/View/index.html
spa
中文教程:code
1. http://v3.bootcss.com/cdn