0

I'm trying to install Bootstrap but it isn't working. I got the css and html from the Bootstrap website, and they seems to work fine, but I think popper and jquery aren't working correctly. I have tried to install both with, npm, from their webpages, and they don't show any error, but when I try to run the code they don't show what I want, which is a carousel working as it should be, the images just stay still, and don't change, only with css and html working. I know that isn't the carousel structure because I tried with cdn. I have the part of the code without the carousel bellow. Is there something to do in those cases?

    <!doctype html>
<html lang="en">
  <head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="Arquivos2/bootstrap-4.5.0-dist/css/bootstrap.min.css">


    <title>Hello, world!</title>
  </head>
  <body> 
    
    <style>

             <!-- Optional JavaScript -->
    <!-- jQuery first, then Popper.js, then Bootstrap JS -->
    <script src="/Arquivos2/jquery-3.5.1.js"></script> 
    <script src="/Arquivos2/jquery22/node_modules/@popperjs/core/dist/esm/popper.js"></script>
    <script src="/Arquivos2/bootstrap-4.5.0-dist/js/bootstrap.min.js"></script>

       
              
          </div>
  </body>
</html>
white_gecko
  • 4,808
  • 4
  • 55
  • 76
Marcelo
  • 77
  • 9
  • 1
    You should put a '.' (dot) to represent relative paths such that your script's src path becomes `./Arquivos2/jquery-3.5.1.js` for instance. Or to keep your URLs consistent, just remove the forward slash just like you linked the bootstrap CSS file. – Aditya Jul 30 '20 at 16:59
  • 1
    The visualcode just drop the bar, and i just choose the folder, so I didn't realized it. Thank you, it works! – Marcelo Jul 30 '20 at 17:06

1 Answers1

0
<!-- First jQuery | then Popper | then Bootstrap -->
<!-- Use the umd directory to import popper. -->

<script src="./node_modules/jquery/dist/jquery.js"></script>
<script src="./node_modules/@popperjs/core/dist/umd/popper.js"></script>
<script src="./node_modules/bootstrap/dist/js/bootstrap.js"></script>