为什么我的Bootstrap代码不起作用? [英] Why is my Bootstrap code not working?

查看:94
本文介绍了为什么我的Bootstrap代码不起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

今晚,我决定尝试使用Bootstrap(仅使用CSS/HTML进行了大约两个星期),但是我遇到了问题.无论出于何种原因,我的HTML文档似乎都没有链接到Bootstrap样式表.我使用了他们的下拉代码片段之一,但最终结果没有风格化.有人可以看看我做错了什么吗?下面是我的HTML代码.

Tonight I decided to give Bootstrap a try (only been doing CSS/HTML for about two weeks), but I'm running into a problem. For whatever reason, it doesn't seem like my HTML doc is linking to the Bootstrap stylesheet. I used one of their dropdown code snippets, but the end result isn't stylized. Can someone see if I'm doing something wrong? Below is my HTML code.

<!DOCTYPE html>


<html lang = "en">

<head>
<title>Test</title>
<link href="css/bootstrap.css" rel="stylesheet" type="text/css" />
<link href="css/bootstrap.min.css" rel="stylesheet" type="text/css" />

</head>
<body>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="js/bootstrap.min.js"></script>

<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>

推荐答案

所有文件都在正确的文件夹中吗?您正在使用相对的url:s,如果您刚开始编写代码,可能会造成混淆.您的文件夹结构如何? index.html和css文件夹是否在同一目录中?

Are all the files in the right folders? You are using relative url:s, can be confusing if you just started to code. How is your folder structure? Are the index.html and the css folder in the same directory?

这篇关于为什么我的Bootstrap代码不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆