0
When I push the button over the dropdown it does not override the other elements of the navbar only site.
HTML
<nav class="navbar">
<a href="#">INÍCIO</a>
<a href="#">SOBRE</a>
<a href="#">ASSISTIR</a>
<a href="#">NOTÍCIAS</a>
<a href="#">PERGUNTAS FREQUENTES</a>
<a href="#">FÓRUNS</a>
<div class="dropdown">
<button class="dropbtn">PRODUTOS</button>
<div class="dropdown-content">
<a href="#">LINK 1</a>
<a href="#">LINK 2</a>
</div>
<a href="#">ASSISTÊNCIA</a>
</nav>
CSS
body {
margin: 0;
padding: 0;
}
.navbar {
background-color: #2A2A2A;
overflow: hidden;
}
.navbar a {
float: left;
color: lightgrey;
text-align: center;
padding: 14px 16px;
text-decoration: none;
font-size: 12px;
}
.dropbtn {
background-color: #2A2A2A;
color: lightgrey;
border: none;
margin-top: 12px;
position: relative;
}
.dropdown {
position: relative;
display: inline-block;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #2A2A2A;
min-width: 180px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}
.dropdown-content a {
color: lightgrey;
padding: 12px 16px;
text-decoration: none;
display: block;
}
.dropdown:hover .dropdown-content {
display: block;
}
try to see this https://codepen.io/lennon/pen/qNaqNB
– Lennon S. Bueno
Gabriel, if you can give feedback if the answer solved the problem. If you can mark it as right to finish the question. Obg!
– Sam