gpt4 book ai didi

css - 为什么 Bootstrap 导航栏不工作?

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

我开始学习 bootstrap,我正在做一个带有导航栏的基本示例。我在此处查看导航栏的 Bootstrap 文档 -> “http://getbootstrap.com/2.3.2/components.html#navbar”,并将代码复制到我的元素中,但菜单显示为未格式化。有什么问题吗?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Untitled Document</title>
<link rel="stylesheet" href="css/template.css" />
<link rel="stylesheet" href="css/bootstrap-theme.min.css" />
<link rel="stylesheet" href="css/bootstrap.min.css" />
<link rel="stylesheet" href="css/bootstrap.css" />
</head>

<body>
<div class="container">
<div class="row" id="topo">
<div class="span5">
<a href="index.html" title="Index">
<img src="logo.png" alt="Logo"/>
</a>
</div>
</div><!--end top-->

<div class="row" id="navegation">
<div class="span12">
<div class="navbar">
<div class="navbar-inner">
<a class="brand" href="#">Title</a>
<ul class="nav">
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
</ul>
</div>
</div>
</div>
</div><!--end navegation-->
</div><!--end container-->


<script src="js/bootstrap.min.js"></script>

</body>
</html>

我得到的是: enter image description here

最佳答案

我认为您已经下载了 Bootstrap 3 文件,但正在阅读 Bootstrap 2 文档。

使用 Bootstrap 2 文件的代码工作正常:http://jsbin.com/vazesuto/1/edit

但是对于 Bootstrap 3 文件,它会产生您所显示的错误:http://jsbin.com/vazesuto/3/edit

尝试阅读 Bootstrap 3 的导航栏文档:http://getbootstrap.com/components/#navbar

关于css - 为什么 Bootstrap 导航栏不工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22028609/

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