Bootstrap 下拉式選單
本章將重點放在 Bootstrap 下拉選單。下拉式選單是可切換的,是以清單格式顯示連結的上下文選單。這可以透過與 下拉式選單(Dropdown) JavaScript 外掛 的互動來實現。
如需使用下列選單,只需在 class .dropdown 內加上下拉式選單即可。下面的實例示範了基本的下拉式選單:
<!DOCTYPE html>
<html>
<head>
<title>Bootstrap 實例 - 下拉選單(1downs)</title>
< > ;link href="http://libs.baidu.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">
<script src="http://libs.baidu.com/bootstrap/3.0.3/js/bootstrap .min.js"<</ script></head>
<body>
##<div class="dropdown">
<button type="button " class="btn dropdown-toggle" id ="dropdownMenu1"
data-toggle="dropdown">
主題
## < dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
下拉式選單標題
presentation" >
Java< /a>
## # 資料探勘</a>
< # <a role="menuitem" tabindex="-1" href="#">a role="menuitem" tabindex="-1" href="#">## </li>
< li role="presentation" class="divider"</li>
<li role="presentation" class="dropdown-header">下拉菜单标题</li>
<li role="presentation">
<a role="menuitem" tabindex="-1" href="#">分离的链接</a>
</li>
</ul>
</div>
</body>
</html>
<html>
<head>
<title>Bootstrap 實例 - 下拉選單(1downs)</title>
< > ;link href="http://libs.baidu.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">
<script src="http://libs.baidu.com/bootstrap/3.0.3/js/bootstrap .min.js"<</ script></head>
<body>
##<div class="dropdown">
<button type="button " class="btn dropdown-toggle" id ="dropdownMenu1"
data-toggle="dropdown">
主題
## < dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
presentation" >
Java< /a>
## # 資料探勘</a>
< # <a role="menuitem" tabindex="-1" href="#">a role="menuitem" tabindex="-1" href="#">## </li>
< li role="presentation" class="divider"</li>
<li role="presentation" class="dropdown-header">下拉菜单标题</li>
<li role="presentation">
<a role="menuitem" tabindex="-1" href="#">分离的链接</a>
</li>
</ul>
</div>
</body>
</html>