我正在尝试使用bootstrap创建pulldown menu
。
但由于某种原因,pulldown menu
没有出现。
我不明白这个概念还是错字?
<div class="container">
<a href="index.php" title="Homepage">
<button type="button" class="btn btn-default sm active">
<span class="glyphicon glyphicon-home"> Home</button></a>
<a href="about.php" title="About">
<button type="button" class="btn btn-default sm">
<span class="glyphicon glyphicon-briefcase"> About</button></a>
<div class="btn-group">
<button type="button" class="btn btn-default sm data-toggle="dropdown">
<span class="glyphicon glyphicon-eye-open"> My Dropdown</button>
<ul class="dropdown-menu" role="menu">
<li><a href="drop1.php">Dropdown 1</a></li>
<li><a href="droop2.php">Dropdown 2</a></li>
</ul>
</div>
</div>
答案 0 :(得分:1)
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<div class="container">
<a href="index.php" title="Homepage">
<button type="button" class="btn btn-default sm active">
<span class="glyphicon glyphicon-home"> Home</button>
</a>
<a href="about.php" title="About"><button type="button" class="btn btn-default sm"><span class="glyphicon glyphicon-briefcase"> About</button></a>
<div class="btn-group">
<button type="button" class="btn btn-default sm" data-toggle="dropdown"><span class="glyphicon glyphicon-eye-open"> My Dropdown</button>
<ul class="dropdown-menu" role="menu">
<li><a href="drop1.php">Dropdown 1</a></li>
<li><a href="droop2.php">Dropdown 2</a></li>
</ul>
</div>
</div>
您的代码
<button type="button" class="btn btn-default sm data-toggle="dropdown">
您错过了"
。
<强>正确强>
<button type="button" class="btn btn-default sm" data-toggle="dropdown">