1 回答
TA贡献1966条经验 获得超4个赞
以下代码测试通过,对容器的class添加dropdown,使得菜单可出现在其下方
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>bootstrap测试</title>
<link href="http://cdn.bootcss.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet" />
<link href="http://cdn.bootcss.com/bootstrap/css/bootstrap-theme.min.css" rel="stylesheet" />
</head>
<body>
<div class="container dropdown" style="margin-bottom: 50px">
<h2 class="page-header">
下拉菜单</h2>
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">字体<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="#">宋体</a></li>
<li><a href="#">黑体</a></li>
<li><a href="#">楷体</a></li>
</ul>
</div>
<script src="http://cdn.bootcss.com/jquery/1.11.1/jquery.min.js"></script>
<script src="http://cdn.bootcss.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
</body>
</html>
- 1 回答
- 0 关注
- 588 浏览
添加回答
举报