国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

Bootstrap Chinese manual / Bootstrap 面板

Bootstrap 面板

Bootstrap 面板(Panels)

本章將講解 Bootstrap 面板(Panels)。面板組件用于把 DOM 組件插入到一個(gè)盒子中。創(chuàng)建一個(gè)基本的面板,只需要向 <div> 元素添加 class .panel 和 class .panel-default 即可,如下面的實(shí)例所示:

實(shí)例

<!DOCTYPE html>
<html>
<head>
   <title>Bootstrap 實(shí)例 - 默認(rèn)的面板</title>
   <link href="http://libs.baidu.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script src="http://libs.baidu.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
</head>
<body>

<div class="panel panel-default">
   <div class="panel-body">
      這是一個(gè)基本的面板
   </div>
</div>

</body>
</html>

運(yùn)行實(shí)例 ?

點(diǎn)擊 "運(yùn)行實(shí)例" 按鈕查看在線實(shí)例

面板標(biāo)題

我們可以通過以下兩種方式來添加面板標(biāo)題:

  • 使用 .panel-heading class 可以很簡單地向面板添加標(biāo)題容器。to easily add a heading container to your panel.

  • 使用帶有 .panel-title class 的 <h1>-<h6> 來添加預(yù)定義樣式的標(biāo)題。

下面的實(shí)例演示了這兩種方式:

實(shí)例

<!DOCTYPE html>
<html>
<head>
   <title>Bootstrap 實(shí)例 - 面板標(biāo)題</title>
   <link href="http://libs.baidu.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script src="http://libs.baidu.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
</head>
<body>

<div class="panel panel-default">
   <div class="panel-heading">
      不帶 title 的面板標(biāo)題
   </div>
   <div class="panel-body">
      面板內(nèi)容
   </div>
</div>

<div class="panel panel-default">
   <div class="panel-heading">
      <h3 class="panel-title">
         帶有 title 的面板標(biāo)題
      </h3>
   </div>
   <div class="panel-body">
      面板內(nèi)容
   </div>
</div>

</body>
</html>

運(yùn)行實(shí)例 ?

點(diǎn)擊 "運(yùn)行實(shí)例" 按鈕查看在線實(shí)例

面板腳注

我們可以在面板中添加腳注,只需要把按鈕或者副文本放在帶有 class .panel-footer 的 <div> 中即可。下面的實(shí)例演示了這點(diǎn):

實(shí)例

<!DOCTYPE html>
<html>
<head>
   <title>Bootstrap 實(shí)例 - 面板腳注</title>
   <link href="http://libs.baidu.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script src="http://libs.baidu.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
</head>
<body>

<div class="panel panel-default">
   <div class="panel-body">
      這是一個(gè)基本的面板
   </div>
   <div class="panel-footer">面板腳注</div>
</div>

</body>
</html>

運(yùn)行實(shí)例 ?

點(diǎn)擊 "運(yùn)行實(shí)例" 按鈕查看在線實(shí)例

面版腳注不會(huì)從帶語境色彩的面板中繼承顏色和邊框,因?yàn)樗皇乔熬爸械膬?nèi)容。

帶語境色彩的面板

使用語境狀態(tài)類 panel-primary、panel-success、panel-info、panel-warning、panel-danger,來設(shè)置帶語境色彩的面板,實(shí)例如下:

實(shí)例

<!DOCTYPE html>
<html>
<head>
   <title>Bootstrap 實(shí)例 - 帶語境色彩的面板</title>
   <link href="http://libs.baidu.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script src="http://libs.baidu.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
</head>
<body>

<div class="panel panel-primary">
   <div class="panel-heading">
      <h3 class="panel-title">面板標(biāo)題</h3>
   </div>
   <div class="panel-body">
      這是一個(gè)基本的面板
   </div>
</div>
<div class="panel panel-success">
   <div class="panel-heading">
      <h3 class="panel-title">面板標(biāo)題</h3>
   </div>
   <div class="panel-body">
      這是一個(gè)基本的面板
   </div>
</div>
<div class="panel panel-info">
   <div class="panel-heading">
      <h3 class="panel-title">面板標(biāo)題</h3>
   </div>
   <div class="panel-body">
      這是一個(gè)基本的面板
   </div>
</div>
<div class="panel panel-warning">
   <div class="panel-heading">
      <h3 class="panel-title">面板標(biāo)題</h3>
   </div>
   <div class="panel-body">
      這是一個(gè)基本的面板
   </div>
</div>
<div class="panel panel-danger">
   <div class="panel-heading">
      <h3 class="panel-title">面板標(biāo)題</h3>
   </div>
   <div class="panel-body">
      這是一個(gè)基本的面板
   </div>
</div>

</body>
</html>

運(yùn)行實(shí)例 ?

點(diǎn)擊 "運(yùn)行實(shí)例" 按鈕查看在線實(shí)例

帶表格的面板

為了在面板中創(chuàng)建一個(gè)無邊框的表格,我們可以在面板中使用 class .table。假設(shè)有個(gè) <div> 包含 .panel-body,我們可以向表格的頂部添加額外的邊框用來分隔。如果沒有包含 .panel-body 的 <div>,則組件會(huì)無中斷地從面板頭部移動(dòng)到表格。

下面的實(shí)例演示了這點(diǎn):

實(shí)例

<!DOCTYPE html>
<html>
<head>
   <title>Bootstrap 實(shí)例 - 帶表格的面板</title>
   <link href="http://libs.baidu.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script src="http://libs.baidu.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
</head>
<body>

<div class="panel panel-default">
   <div class="panel-heading">
      <h3 class="panel-title">面板標(biāo)題</h3>
   </div>
   <div class="panel-body">
      這是一個(gè)基本的面板
   </div>
   <table class="table">
      <th>產(chǎn)品</th><th>價(jià)格 </th>
      <tr><td>產(chǎn)品 A</td><td>200</td></tr>
      <tr><td>產(chǎn)品 B</td><td>400</td></tr>
   </table>
</div>
<div class="panel panel-default">
   <div class="panel-heading">面板標(biāo)題</div>
   <table class="table">
      <th>產(chǎn)品</th><th>價(jià)格 </th>
      <tr><td>產(chǎn)品 A</td><td>200</td></tr>
      <tr><td>產(chǎn)品 B</td><td>400</td></tr>
   </table>
</div>

</body>
</html>

運(yùn)行實(shí)例 ?

點(diǎn)擊 "運(yùn)行實(shí)例" 按鈕查看在線實(shí)例

帶列表組的面板

我們可以在任何面板中包含列表組,通過在 <div> 元素中添加 .panel.panel-default 類來創(chuàng)建面板,并在面板中添加列表組。您可以從 列表組 一章中學(xué)習(xí)如何創(chuàng)建列表組。

實(shí)例

<!DOCTYPE html>
<html>
<head>
   <title>Bootstrap 實(shí)例 - 帶列表組的面板</title>
   <link href="http://libs.baidu.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script src="http://libs.baidu.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
</head>
<body>

<div class="panel panel-default">
   <div class="panel-heading">面板標(biāo)題</div>
      <div class="panel-body">
         <p>這是一個(gè)基本的面板內(nèi)容。這是一個(gè)基本的面板內(nèi)容。
         這是一個(gè)基本的面板內(nèi)容。這是一個(gè)基本的面板內(nèi)容。
         這是一個(gè)基本的面板內(nèi)容。這是一個(gè)基本的面板內(nèi)容。
		 這是一個(gè)基本的面板內(nèi)容。這是一個(gè)基本的面板內(nèi)容。
         </p>
   </div>
   <ul class="list-group">
      <li class="list-group-item">免費(fèi)域名注冊(cè)</li>
      <li class="list-group-item">免費(fèi) Window 空間托管</li>
      <li class="list-group-item">圖像的數(shù)量</li>
      <li class="list-group-item">24*7 支持</li>
      <li class="list-group-item">每年更新成本</li>
   </ul>
</div>

</body>
</html>

運(yùn)行實(shí)例 ?

點(diǎn)擊 "運(yùn)行實(shí)例" 按鈕查看在線實(shí)例