bootstrap 下拉菜单显示不出来

bootstrap 下拉菜单显示不出来


holdtom
浏览 589回答 1
1回答

慕标5832272

以下代码测试通过,对容器的class添加dropdown,使得菜单可出现在其下方<!doctype html><html><head>&nbsp; &nbsp;<meta charset="utf-8">&nbsp; &nbsp;<title>bootstrap测试</title>&nbsp; &nbsp;<link href="http://cdn.bootcss.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet" />&nbsp; &nbsp;<link href="http://cdn.bootcss.com/bootstrap/css/bootstrap-theme.min.css" rel="stylesheet" /></head><body>&nbsp; &nbsp;<div class="container dropdown" style="margin-bottom: 50px">&nbsp; &nbsp; &nbsp; &nbsp;<h2 class="page-header">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;下拉菜单</h2>&nbsp; &nbsp; &nbsp; &nbsp;<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">字体<span class="caret"></span></a>&nbsp; &nbsp; &nbsp; &nbsp;<ul class="dropdown-menu">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<li><a href="#">宋体</a></li>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<li><a href="#">黑体</a></li>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<li><a href="#">楷体</a></li>&nbsp; &nbsp; &nbsp; &nbsp;</ul>&nbsp; &nbsp;</div>&nbsp; &nbsp;<script src="http://cdn.bootcss.com/jquery/1.11.1/jquery.min.js"></script>&nbsp; &nbsp;<script src="http://cdn.bootcss.com/bootstrap/3.2.0/js/bootstrap.min.js"></script></body></html>
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Bootstrap