Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 如何折叠引导4导航栏_Css_Bootstrap 4_Navbar_Collapse - Fatal编程技术网

Css 如何折叠引导4导航栏

Css 如何折叠引导4导航栏,css,bootstrap-4,navbar,collapse,Css,Bootstrap 4,Navbar,Collapse,我在我的项目中使用了Bootstrap网站中的第一个导航栏。我复制了所有代码并粘贴到我的页面。当我最小化页面时,会出现折叠图标。但是,当我单击时,什么也没有发生。有什么问题 搜寻 您需要在jQuery之前包含它的CDN版本,它写在引导文档中。 您需要在jQuery之前包含它的CDN版本,它写在引导文档中。 添加以下CDN: <!-- jQuery and JS bundle w/ Popper.js --> <script src="ht

我在我的项目中使用了Bootstrap网站中的第一个导航栏。我复制了所有代码并粘贴到我的页面。当我最小化页面时,会出现折叠图标。但是,当我单击时,什么也没有发生。有什么问题


搜寻
您需要在jQuery之前包含它的CDN版本,它写在引导文档中。


您需要在jQuery之前包含它的CDN版本,它写在引导文档中。


添加以下CDN:

<!-- jQuery and JS bundle w/ Popper.js -->
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/js/bootstrap.bundle.min.js"></script>

添加以下CDN:

<!-- jQuery and JS bundle w/ Popper.js -->
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/js/bootstrap.bundle.min.js"></script>


您是否将引导样式表链接放在页面上?当然可以。我将cdn添加到我的html文件中。你是否将引导样式表链接放在页面上?是的,当然。我在html文件中添加了cdn。
<!-- jQuery and JS bundle w/ Popper.js -->
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/js/bootstrap.bundle.min.js"></script>