2
Good evening, I’m learning how to use bootstrap 4. I made a menu using navbar
and nav-brand
, everything works normal but when it comes to the sizes sm
and md
for some reason the background size gets smaller than the menu links. That’s why I tried to make the links go below the logo but the links don’t go down to another line when I put the col-sm-12
. When I use the col-sm-12
outside the Navbar
it works normally.
If any of you have any tips, I’d appreciate it. Thank you
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<html>
<head>
<title>Curso de Bootstrap</title>
<meta http-equiv="X-UA-Compatible" content="IE-edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="../bootstrap-4.3.1-dist/css/bootstrap.min.css" rel="stylesheet">
<link href="_css/estilo.css" rel="stylesheet">
</head>
<body>
<div class="container-fluid">
<div class="row">
<nav class="navbar navbar-expand-sm navbar-dark bg-dark col-md-12">
<div class="navbar-header col-12 col-sm-4 col-md-2">
<a href="#" class="navbar-brand"><img src="../img/icone_aftereffects_grande.png" width="50em">After Effects</a>
</div>
<ul class="navbar-nav col-12 col-sm-12 col-md-10">
<li class="nav-item"><a class="nav-link" href="home.html">Home</a></li>
<li class="nav-item"><a class="nav-link" href="info.html">Info</a></li>
<li class="nav-item"><a class="nav-link" href="special-events.html">Special Events</a></li>
<li class="nav-item"><a class="nav-link" href="dvd.html">DVD</a></li>
<li class="nav-item"><a class="nav-link" href="location.htm">Location</a></li>
<li class="nav-item"><a class="nav-link" href="menu.html">Menu</a></li>
<li class="nav-item"><a class="nav-link" href="review.html">Review</a></li>
</ul>
</nav>
</div>
</div>
<!-- Fim do seu codigo -->
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<script src="_js/script.js"></script>
</body>
Thank you, that’s exactly what I had in mind, that the menu just collapses after SM note, but I didn’t know yet that the flex class was for this. Really my navbar was different, had not put the class "navbar Collapse" nor the button with the class "navbar-Toggler". I’ll test here, thanks again.
– sarge88
@sarge88 without problems friend, always consult the documentation, help a lot and already have class ready for almost everything!
– hugocsl