1
My site has a bug that I don’t know when it started, it was working normally, when I clicked on the burger menu the menu went down with the options with a white background and below on Nav, but now it is opening over the Nav which makes it get cut on top, and with the transparent fund so:
My current html:
<nav class="navbar navbar-expand-sm bg-light navbar-light sticky-top">
<div class="container">
<a class="navbar-brand" href="/">
<img src="../imgs/logocompleto.png">
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive"
aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link" href="../cursos/">Cursos</a>
</li>
<li class="nav-item">
<a class="nav-link" href="../unidades/">Unidades</a>
</li>
<li class="nav-item">
<a class="nav-link" href="../testeseuingles/">Teste seu Inglês</a>
</li>
<li class="nav-item">
<a class="nav-link" href="../franquia" target="_blank">Seja um Franqueado</a>
</li>
<li class="nav-item">
<a class="nav-link " data-toggle="modal" id="btncomeceagoraresponsive"
data-target="#ModalSaibaMais">Começe agora</a>
</li>
</ul>
<button type="button" data-toggle="modal" id="btncomeceagora" data-target="#ModalSaibaMais">Começe agora
</button>
</div>
</div>
</nav>
My Responsive CSS:
@media only screen and (max-width: 768px) {
.navbar-nav{
display: flex;
}
.nav-item{
border-radius: 5px;
background-color: #dfe6e9;
margin-top: 4px;
color: #15254B;
}
#btncomeceagora{
display: none;
}
#btncomeceagoraresponsive{
display: block;
}
.footer{
padding: 0.3rem;
}
.footer .container{
text-align: center;
}
.footer .container .row div {
margin-top: 0.5rem;
/*background-color: #ffc107;*/
display: inline-block;
}
.encontreundiade{
width: auto !important;
position: static !important;
border: 0;
margin-top: 0 !important;
margin-left: 0 !important;
box-shadow: 0 0 0 0 !important;
}
#gmap{
width:100%;
height:57vh !important;
}
.ocultarresponsive{
display: none;
}
.row h6{
font-size: 0.9rem;
}
.footer{
position: relative;
}
}
My default css
.navbar {
height: 4rem;
-webkit-box-shadow: 0 8px 3px -0px #999;
-moz-box-shadow: 0 0px 3px 0px #999;
box-shadow: 0 0px 3px 0px #999;
}
/*Costumização Menu*/
.nav-link{
margin-right: 8px;
margin-left: 8px;
transition: color .2s ease-in-out;
}
.nav-link:hover {
/*color: #15254B !important;*/
color: #A71E23 !important;
}
.nav-item .active{
color: #15254B !important;
}
/*Centralizar Menu horizontalmente*/
.navbar-nav {
float:none;
margin:0 auto;
display: block;
text-align: center;
}
.navbar-nav > li {
display: inline-block;
float:none;
}
#btncomeceagora
{
border-radius: 5px;
padding: 5px 15px;
font-size: 15px;
text-decoration: none;
font-weight: 400;
text-transform: uppercase;
margin: 20px;
border: none;
cursor: pointer;
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.16), 0 0 0 1px rgba(0, 0, 0, 0.08);
background-color: #A71E23;
color: #f8f9fa;
position: relative;
display: inline-block;
transition: background .2s ease-in-out;
}
#btncomeceagora:hover
{
background-color: #15254B;
}
Guy here is opening normal. It’s probably something you did in a CSS part other than the original BS4. I suggest you edit your question with your full CSS! The way it is there is no way to answer you precisely.
– hugocsl
@hugocsl put the responsive css
– Igor Oliveira
The answer below did not resolve?
– Sam
I just edited the answer with an option that might be better, up to when your
@media é 768px
, you should use navbar-expand-Md in.navbar
and not -Sm, see more details in reply.– hugocsl