Bootstrap -- 導航欄樣式、分頁樣式、標簽樣式、徽章樣式
1. 使用圖標的導航欄
使用導航欄樣式:

<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>My Test bootstrap</title> <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css"> <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script> <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script> </head> <body> <nav class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="#">Test Bootstrap</a> </div> <ul class="nav navbar-nav navbar-right"> <li><a href="#"><span class="glyphicon glyphicon-user"></span> 注冊</a></li> <li><a href="#"><span class="glyphicon glyphicon-log-in"></span> 登錄</a></li> </ul> </div> </nav> </body> </html>
樣式效果:
2. 分頁(Pagination): 是一種無序列表,Bootstrap 像處理其他界面元素一樣處理分頁。
使用分頁樣式:

<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>My Test bootstrap</title> <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css"> <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script> <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script> </head> <body> <ul class="pagination"> <li><a href="#">«</a></li> <li class="active"><a href="#">1</a></li> <li><a href="#">2</a></li> <li><a href="#">3</a></li> <li><a href="#">4</a></li> <li><a href="#">5</a></li> <li><a href="#">6</a></li> <li><a href="#">»</a></li> </ul> </body> </html>
樣式效果:
3. 標簽樣式
使用樣式:

<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>My Test bootstrap</title> <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css"> <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script> <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script> </head> <body> <span class="label label-default">默認標簽</span> <span class="label label-primary">主要標簽</span> <span class="label label-success">成功標簽</span> <span class="label label-info">信息標簽</span> <span class="label label-warning">警告標簽</span> <span class="label label-danger">危險標簽</span> </body> </html>
樣式效果:
4. 徽章(Badges):主要用於突出顯示新的或未讀的項。如需使用徽章,只需要把 <span class="badge"> 添加到鏈接、Bootstrap 導航等這些元素上即可。
使用徽章樣式:

<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>My Test bootstrap</title> <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css"> <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script> <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script> </head> <body> <ul class="nav nav-pills"> <li class="active"> <a href="#">首頁 <span class="badge">42</span> </a> </li> <li> <a href="#">動態</a> </li> <li> <a href="#">留言</a> </li> <li> <a href="#">消息 <span class="badge">3</span> </a> </li> </ul> </body> </html>
樣式效果: