gpt4 book ai didi

jquery - 为什么我的 Bootstrap 代码不工作

转载 作者:行者123 更新时间:2023-11-28 13:25:36 36 4
gpt4 key购买 nike

我从他们的网站下载了 Bootstrap 代码。我在 bootstrap 目录中写了以下 HTML 文件(这样相对路径是正确的)

<!DOCTYPE html>


<html lang = "en">

<head>
<title>Test</title>
<link href="css/bootstrap.css" rel="stylesheet" type="text/css" />
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="js/bootstrap.min.js"></script>

</head>
<body>

Hello world
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu">
<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>

</body>
</html>

当我在 chrome 中打开该文件时,除了“Hello World”之外我没有看到任何其他内容。我看到另一个问题Why is my Bootstrap code not working?我已经注意相对路径是正确的,但代码仍然无法正常工作。我敢肯定这是非常愚蠢的事情。谁能帮我找出来?

最佳答案

Bootstrap 可以正常工作,您的问题是您从 bootstrap 文档中复制并粘贴了错误的代码。

看起来您刚刚复制并粘贴了位于 components.html 页面顶部的代码 here .

这纯粹是为了说明可能的情况。如果你只想显示这个,你也想改变它:

<ul class='dropdown-menu' role='menu' aria-labelledby='dropdownMenu' style='display: block; position: static'>

不过,为了实际有用,您需要阅读 this文档的一部分将告诉您如何有效地使用它。

JSFiddle它正常工作

关于jquery - 为什么我的 Bootstrap 代码不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13937426/

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