本章将重点讲解bootstrap下拉菜单(Dropdowns),下拉菜单是可切换的,是以列表格式显示链接的上下文菜单。
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Bootstrap历练实例:下拉菜单</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<link rel="stylesheet" href="bootstrap-3.3.5-dist/css/bootstrap.min.css" />
</head>
<body>
<div class="container">
<div class="dropdown">
<button type="button" id="dropdownMenu1" class="btn dropdown-toggle" data-toggle="dropdown">
选择课程
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
<li role="presentation" class="dropdown-header">下拉菜单标题</li>
<li role="presentation">
<a role="menuitem" href="#">Html5</a>
</li>
<li role="presentation">
<a role="menuitem" href="#">Css3</a>
</li>
<li role="presentation">
<a role="menuitem" href="#">JavaScript</a>
</li>
<li role="presentation">
<a role="menuitem" href="#">jQuery</a>
</li>
<li role="presentation">
<a role="menuitem" href="#">jQuery easyUI</a>
</li>
<li role="presentation">
<a role="menuitem" href="#">Bootstrap</a>
</li>
<li role="presentation" class="divider"></li>
<li role="presentation" class="dropdown-header">下拉菜单标题</li>
<li role="presentation">
<a role="menuitem" href="#">C#.Net</a>
</li>
<li role="presentation">
<a role="menuitem" href="#">MsSql</a>
</li>
</ul>
</div>
</div>
<script src="jQuery/jquery-2.1.4.js"></script>
<script src="bootstrap-3.3.5-dist/js/bootstrap.min.js"></script>
</body>
</html>