I made a 'hover' menu but I want to change the color of the gray bar of the menu by pressing the cursor on the 'Search and News' buttons but I do not know how to specify the .navbar address (gray menu) by applying the 'hover' effect on it, even because it is like the main one above the other divs, is there any way to make the gray bar change color by leaning the cursor on the 'search' and 'News' items ?? >
body{background-color:#09C;}
.navbar{ overflow:hidden;
background-color:#666;
font-family:Arial, Helvetica, sans-serif;
}
.navbar a{float: left;
font-size: 16px;
color: #FFF;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
.navbar a:hover, .menu:hover .bt{background-color: #0C0;
}
.menu{float: left;
overflow: hidden;
}
.menu .bt{font-size: 16px;
border: none;
outline: none;
color: #FFF;
padding: 14px 16px;
background-color: inherit;
font-family: inherit;
margin:0;
}
.menu:hover .sub{ display:block;
}
.sub{display: none;
position: absolute;
background-color:#f9f9f9;
min-width: 160px;
}
.sub a{float: none;
color: #000;
padding: 14px 16px;
text-decoration: none;
display: block;
text-align: left;
}
<div class="navbar">
<a href="#">Pesquisas</a>
<div class="menu">
<button class="bt">News</button>
<div class="sub">
<a href="#">Links</a>
<a href="#">Links</a>
<a href="#">Links</a>
</div>
</div>
</div>