Search code examples
htmlcsstwitter-bootstrapcoda

How do I use Bootstrap in Coda2?


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?


Solution

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