我已經創建了一個Navbar Header的頂部導航,其中有一個帶有下拉子菜單和插入符號的4個主要鏈接。用Bootstrap創建的熱門導航不會摺疊子菜單
下拉子菜單沒有摺疊。我試圖找到問題,但找不到它。請參閱下面的代碼片段。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>Bootstrap with HTML</title>
<!-- Bootstrap -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js">
</script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<!-- Navbar with Dropdown Menus -->
<!-- Start Navbar Top -->
<nav class="navbar navbar-default">
<div class="container">
<!-- Toggle buttons snippet - This will define the toggle buttons of the navigation when the screen gets smaller -->
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<!-- End of Toggle button snippet -->
<!-- The Site Name or Brand name snippet -->
<a class="navbar-brand" href="www.youtube.com" target="_blank">The Bootstrap Site with HTML</a>
<!-- End of brand name snippet -->
<!-- The below defines the navigation links in the Navbar. From this point you can create the links for the navigation -->
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<li><a href="#">Home</a>
</li>
<li><a href="#">Technologies</a>
</li>
<li><a href="#">Partners</a>
</li>
<li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="drop-down">Products <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#">SaaS</a>
</li>
<li><a href="#">PaaS</a>
</li>
<li><a href="#">Cloud</a>
</li>
<li><a href="#">IofT</a>
</li>
</ul>
</li>
</ul>
</div>
<!--End of the navigation links in the Navbar -->
</div>
</nav>
<!-- End of Navbar Top -->
</body>
</html>
它爲我在鉻52上工作。您使用哪種瀏覽器? – bazi