Navbar Bootstrap Responsible is not working!

0
<html>
  <head>
    <meta charset="utf-8">
    <title>HARD PUNK - Strange, The Fish</title>
    <link href="./css/bootstrap.min.css" rel="stylesheet"/>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script><scriptsrc="./js/bootstrap.min.js"></script>
    <script src="./js/bootstrap.js"></script>
  </head>  

  <body>
    <header>
      <nav class="navbar navbar-expand-lg navbar navbar-dark bg-dark">
        <a class="navbar-brand" href="./TheStrangerFish.html"><img src="./logo.png" height="50" width="50"  class="d-inline-block align-top" alt=""> HARD PUNK </a>
        <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarN" aria-expanded="false" aria-label="Toggle navigation">
          <span class="navbar-toggler-icon"></span>
        </button>

        <div class="collapse navbar-collapse" id="navbarSupportedContent">
          <ul class="navbar-nav mr-auto">
            <li><a class="nav-link" href="#">Sobre o Jogo</a></li>
            <li><a class="nav-link" href="#">Desenvolvedores</a></li>
            <li><a class="nav-link" href="#">Contato</a></li>
          </ul>
        </div>
      </nav>
    </header>
  </body>  
</html>  
    
asked by anonymous 25.09.2018 / 17:25

1 answer

2

Your problem is that you put a reference of data-target="#navbarNav" different from the ID you used in <div class="collapse navbar-collapse" id="navbarSupportedContent">

Note that putting the same value navbarNav into ID of div id="navbarNav" into your Nav will work.

Follow the template. I did not change anything, I just set target to the right ID.

    <link rel="stylesheet" type="text/css" media="screen" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" />

    <script src="https://code.jquery.com/jquery-3.2.1.min.js"></script><scriptsrc="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>


    <header>
        <nav class="navbar navbar-expand-lg navbar navbar-dark bg-dark">
            <a class="navbar-brand" href="./TheStrangerFish.html"><img src="./logo.png" height="50" width="50" class="d-inline-block align-top"
                    alt=""> HARD PUNK </a>
            <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarN"
                aria-expanded="false" aria-label="Toggle navigation">
                <span class="navbar-toggler-icon"></span>
            </button>
   

            <div class="collapse navbar-collapse" id="navbarNav">
                <ul class="navbar-nav mr-auto">
                    <li><a class="nav-link" href="#">Sobre o Jogo</a></li>
                    <li><a class="nav-link" href="#">Desenvolvedores</a></li>
                    <li><a class="nav-link" href="#">Contato</a></li>
                </ul>
            </div>
        </nav>
    </header>

    
    
25.09.2018 / 17:37