0

I'm pretty new to web design and I'd like to use Bootstrap in some html code I'm writing in Coda2. I don't have access to a server, so I'm using the directory address of css files on my hard drive instead of a web address. Right now the top of my code looks like this:

<!DOCTYPE HTML>

<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Sandbox</title>

    <!-- Bootstrap -->
    <link href="file:///Volumes/Disk/Users/skykalfus/Dropbox/coding_webdev/bootstrap-3.2.0-dist/css/bootstrap-theme.min.css" rel="stylesheet">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
       <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
       <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->

    <link href="file:///Volumes/Disk/Users/skykalfus/Dropbox/coding_webdev/Sandbox/Sandbox%20Stylesheet.css" rel="Sandbox Stylesheet">

</head>

The css stylesheet I made (second-to-last line of code) works fine but I can't get Bootstrap to work. What am I doing wrong?

Sky Kalfus
  • 35
  • 3
  • Your missing the link to the bootstrap JavaScript, you only linked the CSS... And probably missing the link to the jQuery unless you have it at the bottom of your body, just before the tag ends. – BuddhistBeast Jul 11 '14 at 04:09

1 Answers1

2

BuddhistBeast is correct.

Making bootstrap work also needs bootstrap javascript. And jQuery is also a prerequisite.

<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>

Of course, you can point to a local jquery.js file.

jack
  • 72
  • 3
  • Thanks, that's very helpful. I've changed the urls at the very bottom to local urls, but I'm still having trouble - do I need to link the javascript anywhere else in the file? EDIT: Nevermind! It works! Hooray!! – Sky Kalfus Jul 11 '14 at 13:29