-1
Hello
i have two Divs one which is the carousel and the other which is the side-menu but even though both are in display block the carousel div is over the div of the secondary-Manu, I wanted to know why and how to solve this.
Code:
.menu-secundario {
background-color: rgba(45, 189, 129, 0.438);
width: auto;
height: 60px;
display: block;
position: relative;
}
.header-1 {
display: none;
}
.carrossel {
margin-top: 0px;
}
.menu-secundario li {
float: none;
margin-left: 5px;
margin-right: 5px;
height: 40px;
width: 81vw;
padding-top: 20px;
text-align: center;
text-transform: uppercase;
}
.menu-principal {
background: none;
}
.carrossel .b-V-A {
display: none;
}
main {
width: 100vw;
}
.menu-burguer {
display: block;
width: 100%;
position: relative;
align-items: center;
text-align: center;
}
.menu-principal .menu-burguer img {
width: 50px;
height: auto;
margin: 10px;
display: block;
}
.carrossel img {
width: 100vw;
height: auto;
}
<div class="menu-secundario">
<nav>
<ul>
<li><a href="">Historias</a></li>
<li><a href="">Linha temporal</a></li>
<li><a href="">Impacto da poluição</a></li>
<li><a href="">Percurso do rio</a></li>
<li><a href="">Jogo</a></li>
</ul>
</nav>
</div>
<div class="carrossel">
<div class="img1 img" id="img1">
<div class="seta-down">
<img src="../img/seta-down-conti-branco.png" alt="seta-down">
</div>
<div class="b-V-A">
<button class="b1"><a href="#img3">Voltar</a></button>
<button class="b2"><a href="#img2">Avançar</a></button>
</div>
<img src="../img/img_1_car.png" alt="img1">
</div>
<div class="img2 img" id="img2">
<div class="b-V-A">
<button class="b1"><a href="#img1">Voltar</a></button>
<button class="b2"><a href="#img3">Avançar</a></button>
</div>
<img src="../img/img_2_car.jpg" alt="img2">
</div>
<div class="img3 img" id="img3">
<div class="b-V-A">
<button class="b1"><a href="#img2">Voltar</a></button>
<button class="b2"><a href="#img1">Avançar</a></button>
</div>
<img src="../img/img_3_car.jpg" alt="img3">
</div>
</div>
It is because the menu is with a fixed heigth of 60px.
– Sam
@Sam tried to switch to auto and I changed the width to 100vw but it’s still the same... I change the height to what for it to work?
– David Mv
No need to declare
auto
, this value is already the default value of the property. And also no need to put100vw
width, as the div already occupies all width by default. In my view, just delete theheight
that is already one thing below the other in the layout.– Sam
@Sam’s probably right, but I just took the height off the div and it’s still under the other div...
– David Mv