admin管理员组文章数量:1426655
I'm having some issues regarging Bootstrap, I'm following a basic tutorial and all works however the CSS file is not loading properly. I've searched around on StackOverflow however none of it worked. My HTML file is in the exact same folder as the css folder is. This is my code :
<!DOCTYPE html>
<html>
<head>
<meta charset=”utf-8”></meta>
<title>This is a title, oh-ehm-GHEE</title>
<link rel=”stylesheet” href=”css/bootstrap.css” type=”text/css”/>
</head>
<body>
<div class="”container”">
<h1><a href="”#”">Bootstrap Site</a></h1>
<div class="navbar">
<div class="navbar-inner">
<div class="container">
<ul class="nav">
<li class="active"><a href="#">Home</a></li>
<li><a href="#">Projects</a></li>
<li><a href="#">Services</a></li>
<li><a href="#">Downloads</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Contact</a></li>
</ul>
</div>
</div>
</div>
<script src=".10.1.min.js"></script>
<script src=”js/bootstrap.js”></script>
</body>
</html>
I'm having some issues regarging Bootstrap, I'm following a basic tutorial and all works however the CSS file is not loading properly. I've searched around on StackOverflow however none of it worked. My HTML file is in the exact same folder as the css folder is. This is my code :
<!DOCTYPE html>
<html>
<head>
<meta charset=”utf-8”></meta>
<title>This is a title, oh-ehm-GHEE</title>
<link rel=”stylesheet” href=”css/bootstrap.css” type=”text/css”/>
</head>
<body>
<div class="”container”">
<h1><a href="”#”">Bootstrap Site</a></h1>
<div class="navbar">
<div class="navbar-inner">
<div class="container">
<ul class="nav">
<li class="active"><a href="#">Home</a></li>
<li><a href="#">Projects</a></li>
<li><a href="#">Services</a></li>
<li><a href="#">Downloads</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Contact</a></li>
</ul>
</div>
</div>
</div>
<script src="http://code.jquery./jquery-1.10.1.min.js"></script>
<script src=”js/bootstrap.js”></script>
</body>
</html>
Share
Improve this question
edited Sep 18, 2013 at 22:54
madth3
7,34412 gold badges52 silver badges74 bronze badges
asked Sep 18, 2013 at 19:58
BoelensBoelens
191 silver badge4 bronze badges
3
- 1 what does your file/folder structure look like? Likely a path issue to your files – Jon Harding Commented Sep 18, 2013 at 20:04
-
Another thing is you're not closing your
container
div. Indenting properly makes it easier to see this. – KyleMit ♦ Commented Sep 18, 2013 at 20:13 - what is the network tab of the Chrome Inspector (or firebug) saying? Do you get a 404 on the css file? – Pevara Commented Sep 18, 2013 at 20:32
3 Answers
Reset to default 3It looks like fancy quotes snuck into your code, as seen on these two lines:
<div class="”container”">
<h1><a href="”#”">Bootstrap Site</a></h1>
Note the difference between the inner and outer quotes. The same quotes are in your meta
tag, the link
for the stylesheet, and your final script
tag.
Replace the fancy quotes with standard quotes, and as long as your directory structure is right, it should work.
If your html is the same folder as you css? Then there is no css folder or your html is within the css folder am I right?
Try something like this
<link rel=”stylesheet” href=”bootstrap.css” type=”text/css”/>
Did you download the zip file from http://getbootstrap./? Typically the CSS, ICO and JS files are in "assets". So you need to upload those files and reference those files in your HTML. Make sure you have the files uploaded and are referencing correctly.
Also be sure you are referencing the CDN version of jQuery like so:
<script src="//code.jquery./jquery.js"></script>
Using the //code.jquery.... will ensure that your JS will always be up to date and if you ever use "https" on your website your JS files will be secured as well.
Hope that helps.
本文标签: javascriptBootstrapCSS file not loadingStack Overflow
版权声明:本文标题:javascript - Bootstrap - CSS file not loading - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745471485a2659770.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论