知識點:
1、輔助類
2柜砾、響應式工具
3湃望、字體圖標
4、下拉菜單
1痰驱、輔助類
1)文本
<p class="text-muted">本行內容是減弱的</p>
<p class="text-primary">本行內容帶有一個 primary class</p>
<p class="text-success">本行內容帶有一個 success class</p>
<p class="text-info">本行內容帶有一個 info class</p>
<p class="text-warning">本行內容帶有一個 warning class</p>
<p class="text-danger">本行內容帶有一個 danger class</p>
2)背景
<p class="bg-primary">bootstrap課程</p>
<p class="bg-success">bootstrap課程</p>
<p class="bg-info">bootstrap課程</p>
<p class="bg-warning">bootstrap課程</p>
<p class="bg-danger">bootstrap課程</p>
3)關閉按鈕 close
<button class="close">×</button>
4)下拉式菜單 caret
<span class="caret"></span>
5)浮動 pull-left pull-right
<div class="pull-left">向左快速浮動</div>
<div class="pull-right">向右快速浮動</div>
6)清除浮動 clearfix
<div class="clearfix" style="background: #D8D8D8;border: 1px solid #000;padding: 10px;">
<div class="pull-left" style="background:#58D3F7;">向左快速浮動</div>
<div class="pull-right" style="background: #DA81F5;">向右快速浮動</div>
</div>
7)塊級內容居中 center-block
<div class="row">
<div class="center-block" style="width:200px;background-color:#ccc;">
這是 center-block
</div>
</div>
8)顯示证芭、隱藏 show hide
<div class="row" style="padding: 91px 100px 19px 50px;">
<div class="show" style="width:300px;background-color:#ccc;">
這是 show class
</div>
<div class="hidden" style="width:200px;background-color:#ccc;">
這是 hide class
</div>
</div>
9)屏幕閱讀器和鍵盤導航 .sr-only 來把元素對所有設備隱藏,除了屏幕閱讀器 .sr-only-focusable
<div class="row" style="padding: 91px 100px 19px 50px;">
<form class="form-inline" role="form">
<div class="form-group">
<label class="sr-only" for="email">Email 地址</label>
<input type="email" class="form-control" placeholder="Enter email">
</div>
<div class="form-group">
<label class="sr-only" for="pass">密碼</label>
<input type="password" class="form-control" placeholder="Password">
</div>
</form>
</div>
<a class="sr-only sr-only-focusable" href="#content">Skip to main content</a>
2担映、響應式工具
1)visible-xs visible-sm visible-md visible-lg
hidden-xs hidden-sm hidden-md hidden-lg
以超小屏幕(xs)為例废士,可用的 .visible-*-* 類是:visible-xs-block、visible-xs-inline 和 visible-xs-inline-block蝇完。
2)visible-print-block visible-print-inline visible-print-inline-block 瀏覽器隱藏 打印機可見
hidden-print 瀏覽器可見 打印機隱藏
visible-print
<div class="container" style="padding: 40px;">
<div class="row">
<div class="col-xs-6 col-sm-3" style="background-color: #dedef8;border:1px solid #000;">
<span class="hidden-xs">特別小型</span>
<span class="visible-xs">? 在特別小型設備上可見</span>
</div>
<div class="col-xs-6 col-sm-3" style="background-color: #dedef8;border:1px solid #000;">
<span class="hidden-sm">小型</span>
<span class="visible-sm">? 在小型設備上可見</span>
</div>
<div class="col-xs-6 col-sm-3" style="background-color: #dedef8;border:1px solid #000;">
<span class="hidden-md">中型</span>
<span class="visible-md">? 在中型設備上可見</span>
</div>
<div class="col-xs-6 col-sm-3" style="background-color: #dedef8;border:1px solid #000;">
<span class="hidden-lg">大型</span>
<span class="visible-lg">? 在大型設備上可見</span>
</div>
</div>
</div>
3官硝、字體圖標
用法:<span class="glyphicon glyphicon-search"></span>
4、下拉菜單
1)基本的下拉菜單
<div class="dropdown">
<button class="btn btn-default dropdown-toggle" data-toggle="dropdown">Dropdown <span class="caret"></span></button>
<ul class="dropdown-menu">
<li><a href="">Html</a></li>
<li><a href="">Javascript</a></li>
<li><a href="">jQuery</a></li>
<li><a href="">html5+css3</a></li>
</ul>
</div>
2)對齊
dropdown-menu-right
3)標題 不要加超鏈接
<ul class="dropdown-menu">
...
<li class="dropdown-header">Dropdown header</li>
...
</ul>
4)分隔線
<ul class="dropdown-menu">
...
<li class="divider"></li>
...
</ul>
5)禁用的菜單項
<ul class="dropdown-menu" aria-labelledby="dropdownMenu4">
<li><a href="#">Regular link</a></li>
<li class="disabled"><a href="#">Disabled link</a></li>
<li><a href="#">Another link</a></li>
</ul>
6)讓菜單默認顯示
<div class="dropdown open">