gpt4 book ai didi

css - Bootstrap 导航不起作用

转载 作者:太空宇宙 更新时间:2023-11-03 21:09:15 24 4
gpt4 key购买 nike

当我试图给类导航栏 navbar-inverse 时,Bootstrap 不工作它在这里不工作我将提供代码。我的控制台错误是 Uncaught TypeError: Cannot read property 'fn' of undefined at setTransitionEndSupport。

<html ng-app="myApp">

<head>
<title></title>
<meta charset="utf-8" />
<link href="Content/bootstrap.css" rel="stylesheet" />
<script src="scripts/bootstrap.js"></script>
</head>

<body>
<div class="container">
<div role="navigation" class="navbar navbar-inverse">
<ul class="nav navbar-nav">
<li><a href="#/home">Home</a></li>
<li><a href="#/add">Add</a></li>
<li><a href="#/edit">Edit</a></li>
<li><a href="#/delete">Delete</a></li>
</ul>
</div>
<div ng-view></div>
<script src="scripts/angular-min.js"></script>
<script src="scripts/angular-route.js"></script>
<script src="demo.js"></script>
</div>
</body>

</html>

最佳答案

正如您所说,您使用的是 bootstrap 4 而您使用的是 bootstrap 3 的导航栏,因此它无法正常工作。我已经添加了 bootstrap 4 的导航代码及其工作。检查下面的片段

<html ng-app="myApp">

<head>
<title></title>
<meta charset="utf-8" />
<link href="Content/bootstrap.css" rel="stylesheet" />
<script src="scripts/bootstrap.js"></script>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">

<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

<!-- Popper JS -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"></script>

<!-- Latest compiled JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
</head>

<body>
<div class="container">


<nav class="navbar navbar-expand-sm bg-light navbar-light">
<ul class="navbar-nav">
<li class="nav-item active">
<a class="nav-link" href="#">Active</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>

</ul>
</nav>

<div ng-view></div>
<script src="scripts/angular-min.js"></script>
<script src="scripts/angular-route.js"></script>
<script src="demo.js"></script>
</div>
</body>

</html>

或检查here

关于css - Bootstrap 导航不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48741049/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com