0

As the title implies, I have a bootstrap related problem. I downloaded the source code, because I would like to change it a little bit later. However, when I include it in my .html document, bootstrap doesn't style the document as it should. Also, when i change the path to bootstrap.js and bootstrap.css to maxcdn links, it all works as it should. Bellow is the code I used and a screenshot of what happens.

I'm hoping someone will be able to help me sort this out. Thank you in advance!

P.S. I am sure that the paths to the files are correct, I have check several times.

<head>
  <title>Bootstrap Case</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">

  <link rel="stylesheet" type="text/css" href="bootstrap/docs/assets/css/bootstrap.css" />
  <link rel="stylesheet" type="text/css" href="bootstrap/docs/assets/js/bootstrap.min.js" />

  <!-- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> -->
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
  <!-- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> -->
</head>

<body>
<nav class="navbar navbar-default">
  <div class="container-fluid">
    <div class="navbar-header">
      <a class="navbar-brand" href="#">WebSiteName</a>
    </div>
    <ul class="nav navbar-nav">
      <li class="active"><a href="#">Home</a></li>
      <li><a href="#">Page 1</a></li>
      <li><a href="#">Page 2</a></li>
      <li><a href="#">Page 3</a></li>
    </ul>
  </div>
</nav>
</body>

How it looks: how it looks

How it should look: how it should look

2 Answers 2

2

Problem is in this line

  <link rel="stylesheet" type="text/css" href="bootstrap/docs/assets/js/bootstrap.min.js" />

It will be

  <script src="bootstrap/docs/assets/js/bootstrap.min.js"></script>
Sign up to request clarification or add additional context in comments.

2 Comments

I understand what I did wrong, and I have fixed it. However, the same thing is still happening. Do I need to install some dependencies in order for Bootstrap to work?
Make sure that your .css .js file placed in correct path. Than it should be work properly. Also you can run your app with inspect mode. It will show you java script related error if java script isn't load properly.
-1

I checked your code i think there is some problem in your file structure.please make sure it properly given

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.