欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

分享bootstrap學(xué)習(xí)筆記心得(組件及其屬性)

 更新時(shí)間:2017年01月11日 10:33:38   作者:zxyolo  
Bootstrap是一種web框架,是基于HTML,CSS和JS的一種目前較為流行的前端框架。本篇文章將總結(jié)常用組件及其屬性,需要的朋友參考下吧

 Bootstrap是一種web框架,是基于HTML,CSS和JS的一種目前較為流行的前端框架。

Bootstrap包含有豐富的組件,根據(jù)提供的組件,開(kāi)發(fā)者可以更加快速、便捷地搭建自己心儀的網(wǎng)站。通常包括有以下常用組件:下拉菜單、按鈕組、按鈕下拉菜單、導(dǎo)航、導(dǎo)航條、分頁(yè)、排版、縮略圖、警告對(duì)話(huà)框、進(jìn)度條、媒體對(duì)象等。此外,bootstrap還包含有眾多jQuery插件:莫泰局昂、標(biāo)簽頁(yè)、滾動(dòng)條、彈出框等。

有關(guān)bootstrap的下載和文檔可到bootstrap中文網(wǎng):www.bootcss.com查看。

那么使用bootstrap的優(yōu)勢(shì)在哪里?第一、利于開(kāi)發(fā)響應(yīng)式網(wǎng)站,解決不同設(shè)備的兼容性問(wèn)題。第二、提高了網(wǎng)站的開(kāi)發(fā)速度和開(kāi)發(fā)效率。

參考:如何使用Bootstrap的modal組件自定義alert,confirm和modal對(duì)話(huà)框

Bootstrap學(xué)習(xí)系列之使用 Bootstrap Typeahead 組件實(shí)現(xiàn)百度下拉效果

本篇文章將總結(jié)常用組件及其屬性。

1.1柵格系統(tǒng)

1、柵格系統(tǒng)是一種行和列構(gòu)成的一種布局。隨著,屏幕分辨率的變大,最多可展示12個(gè)列。

PC端:

PAD端:

手機(jī)終端:

2、柵格參數(shù):

col-lg-*:(屏幕>=1200px) PC
col-md-*:(992px-1200px)
col-sm-*:(768px-992px)小平板
col-xs-*:(小于768px)手機(jī)

3.代碼示例:

<div class="container" style="border:1px solid red;"> 
 <div class="row"> 
  <div class="col-lg-3 col-sm-4 col- xs-6"> 
   <div class="thumbnail"> 
    <img src="img/codeguide.png"> 
    <h2>靠譜研究所</h2> 
    <p>我們的口號(hào)是:靠譜、有趣、有料</p> 
   </div> 
  </div> 
  <div class="col-lg-3 col-sm-4 col- xs-6"> 
   <div class="thumbnail"> 
    <img src="img/codeguide.png"> 
    <h2>靠譜研究所</h2> 
    <p>我們的口號(hào)是:靠譜、有趣、有料</p> 
   </div> 
  </div> 
 </div>  
 </div> 

1.2輔助類(lèi)

1.文本顏色:

<span style="white-space:pre"> </span> <h1 class="text-primary">text-primary靠譜研究所</h1> 
  <h1 class="text-success">text-success靠譜研究所</h1> 
  <h1 class="text-warning">text-warning靠譜研究所</h1> 
  <h1 class="text-danger">text-danger靠譜研究所</h1> 
  <h1 class="text-info">text-info靠譜研究所</h1> 
  <h1 class="text-muted">text-muted靠譜研究所</h1> 

2、背景顏色:

<span style="white-space:pre"> </span> <h1 class="bg-primary">text-primary靠譜研究所</h1> 
  <h1 class="bg-success">text-success靠譜研究所</h1> 
  <h1 class="bg-warning">text-warning靠譜研究所</h1> 
  <h1 class="bg-danger">text-danger靠譜研究所</h1> 
  <h1 class="bg-info">text-info靠譜研究所</h1> 
  <h1 class="bg-muted">text-muted靠譜研究所</h1> 

3、關(guān)閉按鈕&三角圖標(biāo):

<span style="white-space:pre"> </span> <!--關(guān)閉按鈕--> 
  <button class="close"><span>×</span></button> 
  <!--三角圖標(biāo)--> 
  <span class="caret"></span> 

4、快速浮動(dòng):

左浮動(dòng):pull-left

右浮動(dòng):pull-right 清除浮動(dòng):clearfix

浮動(dòng)會(huì)將塊元素轉(zhuǎn)換成行內(nèi)元素

<div class="pull-left bg-primary">這是左邊的內(nèi)容</div> 
 <div class="pull-right bg-danger">這是右邊的內(nèi)容</div> 

  5、塊元素居中、文字居中:

<!--塊元素垂直居中--> 
 <style> 
  #div2{ 
  position:absolute; 
  left:50%; 
  top:50%; 
  transform:translate(-50%,-50%);//平移 
  } 
 </style> 
<span style="white-space:pre"> </span><!--實(shí)現(xiàn)塊元素水平居中--> 
 <div id="div1" class="center-block text-center" style="width:500px;border:1px solid red;">塊元素水平居中</div> 
 <!--實(shí)現(xiàn)塊元素垂直居中--> 
 <div id="div2" class="center-block text-center" style="width:500px;border:1px solid red;">塊元素垂直居中</div> 

1.3表格

1.表格顏色:active,warning,danger,info,danger

2.鼠標(biāo)懸停效果:table-hover

3.帶邊框表格:table-bordered

4.各行換色:table-striped

<table class="table table-striped table-hover table-bordered"><!--隔行換色、鼠標(biāo)懸停、表格邊框--> 
   <thead> 
    <tr class="danger"><!--表格顏色--> 
     <th>姓名:</th> 
     <th>性別:</th> 
     <th>年齡:</th> 
    </tr> 
   </thead> 
   <tbody> 
    <tr> 
     <td>張三</td> 
     <td>男</td> 
     <td>23</td> 
    </tr> 
    <tr> 
     <td>張三</td> 
     <td>男</td> 
     <td>23</td> 
    </tr> 
    <tr> 
     <td>張三</td> 
     <td>男</td> 
     <td>23</td> 
    </tr> 
   </tbody> 
  </table> 

1.4列表:

class屬性:ul:list-group

li:list-group-item 徽章:span:badge                                                                                            

 列表項(xiàng)顏色:list-group-item-(success/warning/danger)

 <ul class="list-group"> 
 <li class="list-group-item"> 
 靠譜研究所 
 <!--列表徽章--><span class="badge">10</span> 
 </li> 
 <li class="list-group-item list-group-item-success">IT研究所</li> 
 <li class="list-group-item list-group-item-warning">美食研究所</li> 
 <li class="list-group-item list-group-item-info">美妝研究所</li> 
</ul> 

1.5表單:

表單分組:form-group

表單項(xiàng):(input/span/textarea):form-control

<style> 
 .container{ 
  width:450px; 
  height:300px; 
  background:#ffffff; 
  position:absolute; 
  left:50%; 
  top:50%; 
  transform:translate(-50%,-50%); 
  border-radius:20px; 
 } 
 </style> 
<span style="white-space:pre"> </span><form role="form"> 
   <h3 class="text-center">靠譜研究所后臺(tái)管理系統(tǒng)</h3> 
   <div class="form-group has-success has-feedback"> 
    <label for="user">用戶(hù)名</label> 
    <input type="text" id="user" placeholder="請(qǐng)輸入用戶(hù)名" class="form-control"> 
    <span class="glyphicon glyphicon-ok form-control-feedback"></span> 
   </div> 
   <div class="form-group has-error has-feedback"> 
    <label for="pass">密碼</label> 
    <input type="text" id="pass" placeholder="請(qǐng)輸入密碼" class="form-control"> 
    <span class="glyphicon glyphicon-remove form-control-feedback"></span> 
   </div> 
   <div class="checkbox"> 
    <label> 
     <input type="checkbox">請(qǐng)記住我 
    </label> 
   </div> 
   <button type="submit" class="btn btn-success btn-block">提交</button> 
  </form> 

相關(guān)文章

最新評(píng)論