Bootstrap 3 How-To #1 下載與配置

來源:互聯網
上載者:User

標籤:des   style   blog   http   color   os   io   使用   java   

Bootstrap 3 發布了,通過簡單的幾步,我們就可以使用 Bootstrap 的樣式表,表徵圖,以及 javascript 來配置一個簡單的網站。

準備

Bootstrap 不僅僅是一個代碼集,還是一個線上社區。作為開始,你需要從熟悉 bootstrap 網站開始:http://getbootstrap.com。

目前版本是 3.0 ,你應該看到如上的頁面。

在這裡,你可以找到如下內容:

文檔

如果這是你第一次訪問這個網站,沖一杯熱茶,細心地閱讀這個網站的頁面,查看每個組件,閱讀詳細的說明,沉浸在其中,你會發現非常的有趣。

下載

你可以擷取最新版本的 bootstrap:樣式表,指令碼,外掛程式,以及表徵圖。已經完全處理好,可以直接使用,並且封裝在一個壓縮包內,我們將從這裡開始。

如何完成

不管你現在水平如何,我都會帶你完成全部的步驟。

1. 訪問 bootstrap 的首頁:http://getbootstrap.com

2. 點擊 Download Bootstrap 按鈕,你會下載一個名為 bootstrap-3.0.0.zip 的檔案。

3. 找到下載的檔案,然後解壓。你會看到一個名為 bootstrap-3.0.0 的檔案夾,在其中你會看到如下的檔案結構。

其中 dist 檔案夾中包含了我們主要使用的檔案。

4. 在首頁的導覽功能表中,點擊 Getting Started 。

5. 在左邊的導航連結中,找到樣本的連結:Examples

6. 找到第一個樣本 Starter template,把它下載儲存起來,你也可以在 bootstrap-3.0.0\examples\starter-template 檔案夾中找到它,包含了兩個檔案。

你已經準備好了!

檔案的內容應該如下所示:

<!DOCTYPE html><html lang="en">  <head>    <meta charset="utf-8">    <meta name="viewport" content="width=device-width, initial-scale=1.0">    <meta name="description" content="">    <meta name="author" content="">    <link rel="shortcut icon" href="../../assets/ico/favicon.png">    <title>Starter Template for Bootstrap</title>    <!-- Bootstrap core CSS -->    <link href="../../dist/css/bootstrap.css" rel="stylesheet">    <!-- Custom styles for this template -->    <link href="starter-template.css" rel="stylesheet">    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->    <!--[if lt IE 9]>      <script src="../../assets/js/html5shiv.js"></script>      <script src="../../assets/js/respond.min.js"></script>    <![endif]-->  </head>  <body>    <div class="navbar navbar-inverse navbar-fixed-top">      <div class="container">        <div class="navbar-header">          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">            <span class="icon-bar"></span>            <span class="icon-bar"></span>            <span class="icon-bar"></span>          </button>          <a class="navbar-brand" href="#">Project name</a>        </div>        <div class="collapse navbar-collapse">          <ul class="nav navbar-nav">            <li class="active"><a href="#">Home</a></li>            <li><a href="#about">About</a></li>            <li><a href="#contact">Contact</a></li>          </ul>        </div><!--/.nav-collapse -->      </div>    </div>    <div class="container">      <div class="starter-template">        <h1>Bootstrap starter template</h1>        <p class="lead">Use this document as a way to quickly start any new project.<br> All you get is this text and a mostly barebones HTML document.</p>      </div>    </div><!-- /.container -->    <!-- Bootstrap core JavaScript    ================================================== -->    <!-- Placed at the end of the document so the pages load faster -->    <script src="../../assets/js/jquery.js"></script>    <script src="../../dist/js/bootstrap.min.js"></script>  </body></html>

而 starter-template.css 檔案的內容如下所示:

body {  padding-top: 50px;}.starter-template {  padding: 40px 15px;  text-align: center;}

開啟這個頁面,你應該看到如下的內容。

祝賀你!你的第一個 bootstrap 網站已經開始工作了。

有問題了?不用擔心,如果你的頁面看起來與上面的不同,我們找一下問題所在:

  • 檔案夾與檔案名稱正確嗎?
  • 樣式表檔案和指令檔的路徑正確嗎?

 

Bootstrap 3 How-To #1 下載與配置

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.