小男孩‘自慰网亚洲一区二区,亚洲一级在线播放毛片,亚洲中文字幕av每天更新,黄aⅴ永久免费无码,91成人午夜在线精品,色网站免费在线观看,亚洲欧洲wwwww在线观看

分享

bootstrap精簡(jiǎn)教程

 sywjnew 2015-07-08

bootstrap精簡(jiǎn)教程

時(shí)間 2015-04-21 23:55:58 博客園_蟲師

bootstrap 的學(xué)習(xí)非常簡(jiǎn)單,并且它所提供的樣式又非常精美。只要稍微簡(jiǎn)單的學(xué)習(xí)就可以制作出漂亮的頁(yè)面。

bootstrap 中文網(wǎng): http://v3./

bootstrap 提供了三種類型的下載:

-------------------------------------------------------------

用于生產(chǎn)環(huán)境的 Bootstrap

編譯并壓縮后的 CSS 、 JavaScript  和字體文件。不包含文檔和源碼文件。

Bootstrap 源碼

Less JavaScript  和 字體文件的源碼,并且?guī)в形臋n。需要  Less  編譯器和 一些設(shè)置工作。

Sass

這是 Bootstrap  從  Less  到  Sass  的源碼移植項(xiàng)目 ,用于快速地在  Rails 、 Compass  或 只針對(duì)  Sass  的項(xiàng)目中引入。

------------------------------------------------------------

其實(shí)我們不用下載 bootstrap 也可以使用它:

Bootstrap 中文網(wǎng) 為  Bootstrap  專門構(gòu)建了自己的免費(fèi)  CDN  加速服務(wù)?;趪?guó)內(nèi)云廠商的  CDN  服務(wù),訪問(wèn)速度更快、加速效果更明顯、沒(méi)有速度和帶寬限制、永久免費(fèi)。

base.html

<!DOCTYPE html>
<html lang="zh-CN">
  <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個(gè)meta標(biāo)簽*必須*放在最前面,任何其他內(nèi)容都*必須*跟隨其后! -->
  <title>Bootstrap 101 Template</title>
  <!-- Bootstrap -->
  <link rel="stylesheet" href="http://cdn./bootstrap/3.3.4/css/bootstrap.min.css">
  </head>
  <body>
  <h1>你好,bootstrap!</h1>
  <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
  <script src="http://cdn./jquery/1.11.2/jquery.min.js"></script>
  <!-- Include all compiled plugins (below), or include individual files as needed -->
  <script src="http://cdn./bootstrap/3.3.4/js/bootstrap.min.js"></script>
  </body>
</html>

base.html 中已經(jīng)引入了 bootstrap ,將其保存,我們就可以使用 bootstrap 提供的樣式了。

字體圖標(biāo)

bootstrap 默認(rèn)提供了二百多個(gè)圖標(biāo)。我們可以通過(guò) span 標(biāo)簽來(lái)使用這些圖標(biāo):

<h3>圖標(biāo)</h3>   
    <span class="glyphicon glyphicon-home"></span>
    <span class="glyphicon glyphicon-signal"></span>
    <span class="glyphicon glyphicon-cog"></span>
    <span class="glyphicon glyphicon-apple"></span>
    <span class="glyphicon glyphicon-trash"></span>
    <span class="glyphicon glyphicon-play-circle"></span>
    <span class="glyphicon glyphicon-headphones"></span>

按鈕

<button></button> 標(biāo)簽用于創(chuàng)建按鈕, bootstrap 提供了豐富的按鈕樣式。

    <h3>按鈕</h3>
    <button type="button" class="btn btn-default">按鈕</button>
    <button type="button" class="btn btn-primary">primary</button>
    <button type="button" class="btn btn-success">success</button>
    <button type="button" class="btn btn-info">info</button>
    <button type="button" class="btn btn-warning">warning</button>
    <button type="button" class="btn btn-danger">danger</button>
    
    <h3>按鈕尺寸</h3>
    <button type="button" class="btn btn-default">按鈕</button>
    <button type="button" class="btn btn-primary btn-lg">primary</button>
    <button type="button" class="btn btn-success btn-sm">success</button>
    <button type="button" class="btn btn-info btn-xs">info</button>

    <h3>把圖標(biāo)顯示在按鈕里</h3>
    <button type="button" class="btn btn-default"><span class="glyphicon glyphicon-home"></span>  按鈕</button>

按鈕除了有默認(rèn)的大小外, bootstrap 還提供三個(gè)參數(shù)來(lái)調(diào)整按鈕的大小,分別是: btn-lg btn-sm btn-xs 。

下拉菜單

下拉菜單是最常見的交互之一,bootstrap提供了漂亮的樣式。

     <h3>下拉菜單</h3>
<div class="dropdown">
  <button class="btn btn-primary dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-expanded="true">
    Dropdown
    <span class="caret"></span>
  </button>
  <ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
    <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Action</a></li>
    <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Another action</a></li>
    <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Something else here</a></li>
    <li role="presentation"><a role="menuitem" tabindex="-1" href="#">Separated link</a></li>
  </ul>
</div>

輸入框

通過(guò)<input></input>標(biāo)簽去創(chuàng)建輸入框。

<h3>輸入框</h3>
<div class="input-group">
  <span class="glyphicon glyphicon-user"></span>
  <input type="text" placeholder="username">
</div>

<div class="input-group">
  <span class="glyphicon glyphicon-lock"></span>
  <input type="password" placeholder="password">
</div>

導(dǎo)航欄

導(dǎo)航欄作為整個(gè)網(wǎng)站的指引必不可少。

    <h3>導(dǎo)航欄</h3>
<nav class="navbar navbar-inverse navbar-fixed-top">
    <div id="navbar" class="navbar-collapse 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>
        <li class="dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Dropdown <span class="caret"></span></a>
          <ul class="dropdown-menu" role="menu">
            <li><a href="#">Action</a></li>
            <li><a href="#">Another action</a></li>
            <li class="divider"></li>
            <li class="dropdown-header">Nav header</li>
            <li><a href="#">Separated link</a></li>
          </ul>
        </li>
      </ul>
    </div><!--/.nav-collapse -->
  </div>
</nav>

表單

人與系統(tǒng)之間數(shù)據(jù)的傳遞都需要依靠表單來(lái)完成。比如注冊(cè) / 登錄信息的提交,查詢條件的提交等。用 <form></form> 標(biāo)簽來(lái)創(chuàng)建表單。

   <h3>表單</h3>
  <form>
  <div class="form-group">
    <span class="glyphicon glyphicon-user"></span>
    <input type="email" id="exampleInputEmail1" placeholder="Enter email">
  </div>
  <div class="form-group">
    <span class="glyphicon glyphicon-lock"></span>
    <input type="password" id="exampleInputPassword1" placeholder="Password">
  </div>
  <div class="form-group">
    <label for="exampleInputFile">File input</label>
    <input type="file" id="exampleInputFile">
    <p class="help-block">Example block-level help text here.</p>
  </div>
  <div class="checkbox">
    <label>
      <input type="checkbox"> Check me out
    </label>
  </div>
  <button type="submit" class="btn btn-default">Submit</button>
</form>

警告框

警告框是系統(tǒng)向用戶傳達(dá)信息和提供指引的重要手段。沒(méi)有針對(duì)警告框的標(biāo)簽,通過(guò) bootstrap 所提供的樣式可以瞬間制作出漂亮的警告框。

  <h3>警告框</h3>
<div class="alert alert-warning alert-dismissible" role="alert">
   <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
   <strong>Warning!</strong> Better check yourself, you're not looking too good.
</div>
<div class="alert alert-success" role="alert">
  <a href="#" class="alert-link">success!</a>
</div>
<div class="alert alert-info" role="alert">
  <a href="#" class="alert-link">info!</a>
</div>
<div class="alert alert-warning" role="alert">
  <a href="#" class="alert-link">warning!</a>
</div>
<div class="alert alert-danger" role="alert">
  <a href="#" class="alert-link">danger!</a>
</div>

進(jìn)度條

系統(tǒng)的處理過(guò)程往往需要用戶等待,進(jìn)度條可以讓用戶感知到系統(tǒng)的處理過(guò)程,從而增加容忍度。

<h3>進(jìn)度條</h3>
    <div class="progress">
      <div class="progress-bar" role="progressbar" aria-valuenow="70" aria-valuemin="0" aria-valuemax="100" style="width: 60%;">
        70%
      </div>
    </div>

=========== 結(jié)束 ===========

1、我覺(jué)得前段更像是藝術(shù),人們對(duì)美好的東西從來(lái)不會(huì)產(chǎn)生分歧。前段更像是通過(guò)技術(shù)展示美好。

2、前段技術(shù)的學(xué)習(xí)是所見即所得,你可以任意的修改標(biāo)簽及其屬性,并且立馬看到修改后的效果。

3、對(duì)于 bootstrap 來(lái)說(shuō),標(biāo)簽最重要的屬性就是 class ,因?yàn)槭褂玫牟煌?/span> class 屬性值,可以使你的標(biāo)簽樣式顏色發(fā)生變化。

4、這篇文章很簡(jiǎn)單,只是羅列一些最基本的頁(yè)面元素組成。 bootstrap 更多的學(xué)習(xí): http://v3./

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購(gòu)買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶 評(píng)論公約