-1
I’m trying to create a responsive menu but, when it’s in the small device view, the button appears but click does not open the links:
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<title>Português fácil</title>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<a href="#" class="navbar-brand">Português fácil</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#menuPrincipal" aria-controls="menuPrincipal" aria-expanded="false" aria-label="Menu collapse">
<span class="navbar-toggler-icon"></span>
</button>
<div id="menuPrincipal" class="collapse navbar-collapse">
<ul class="navbar-nav">
<li class="nav-item">
<a href="#" class="nav-link">Inicio</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link">Contato</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link">Sobre</a>
</li>
</ul>
</div>
</nav>
<!-- Scrips -->
<script type="text/javascript" href="js/jquery-3.5.1.min.js"></script>
<script type="text/javascript" href="js/bootstrap.min.js"></script>
</body>
</html>
Here it worked normal. Take a test with these two libraries:
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css">
and<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js"></script>
– Sam
It did not work, when I lower the screen the button appears, but when clicking the links are not shown
– Marcelo Alves
I tested it here and it works right.
– Sam