Bootstrap 中的下拉菜单我们不起作用 [英] Drop Down menu in Bootstrap us not working

查看:29
本文介绍了Bootstrap 中的下拉菜单我们不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚开始在 twitter bootstrap 上工作.我正在尝试创建一个下拉菜单示例.但它没有显示任何内容.任何人都可以告诉我我错在哪里.我的代码是

<头><title>Bootstrap 101 模板</title><meta name="viewport" content="width=device-width, initial-scale=1.0"><!-- 引导程序--><link href="css/bootstrap.min.css" rel="stylesheet" media="screen"><身体><h1>你好,世界!</h1><div class="下拉菜单"><!-- 切换下拉菜单的链接或按钮--><ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"><li><a tabindex="-1" href="#">Action</a></li><li><a tabindex="-1" href="#">另一个动作</a></li><li><a tabindex="-1" href="#">这里还有别的东西</a></li><li class="divider"></li><li><a tabindex="-1" href="#">分隔链接</a></li>

<script src="http://code.jquery.com/jquery.js"></script><script src="js/bootstrap.min.js"></script></html>

除了标题 Hello World 之外,它没有显示任何内容.

解决方案

您有下拉菜单,但没有激活下拉菜单的按钮.

看这里:

http://twitter.github.com/bootstrap/components.html#buttonDropdowns

<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">行动<span class="caret"></span></a><ul class="下拉菜单"><!-- 下拉菜单链接-->

hi i just started working on twitter bootstrap.i am trying to create a drop down menu example.but its not shwing anything.can any one please tell me where i am wrong.my code is

<!DOCTYPE html>
<html>
  <head>
    <title>Bootstrap 101 Template</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- Bootstrap -->
    <link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
  </head>
  <body>
    <h1>Hello, world!</h1>
<div class="dropdown">
  <!-- Link or button to toggle dropdown -->
  <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
    <li><a tabindex="-1" href="#">Action</a></li>
    <li><a tabindex="-1" href="#">Another action</a></li>
    <li><a tabindex="-1" href="#">Something else here</a></li>
    <li class="divider"></li>
    <li><a tabindex="-1" href="#">Separated link</a></li>
  </ul>
</div>
    <script src="http://code.jquery.com/jquery.js"></script>
    <script src="js/bootstrap.min.js"></script>
  </body>
</html>

its not showing anything except heading Hello World.

解决方案

You've got the dropdown but you don't have the button that activates the dropdown.

Look here:

http://twitter.github.com/bootstrap/components.html#buttonDropdowns

<div class="btn-group">
 <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
 Action
 <span class="caret"></span>
 </a>
 <ul class="dropdown-menu">
  <!-- dropdown menu links -->
 </ul>
</div>

这篇关于Bootstrap 中的下拉菜单我们不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆