So the issue I'm having is that I have created my navbar and implemented a gradient color scheme. All good.
I've then added a couple of drop down buttons to the menu which function as required, however I can't work out how to keep the original navbar color scheme on those buttons.
I tried adding the code again, but obviously this creates a new gradient within the button. And if I remove the color then it switches out to the same color as the drop down background.
Here's a snippet of the navbar html:
<div class="dropdown">
<button class="dropbutton">Gaming</button>
<div class="dropdown-content">
<a href="pc.html">PC</a>
<a href="xbox.html">Xbox</a>
<a href="playstation.html">PlayStation</a>
<a href="nintendo.html">Nintendo</a>
</div>
</div>
And the navbar CSS:
.navbar {
display: flex;
background-image: linear-gradient(to bottom right, #581CBE, #F00E96);}
.navbar a {
color: #FFFFFF;
padding: 16px 20px;
text-decoration: none;
text-align: center;}
.navbar a:hover: {
background-color: #EA14EA;
color: black;}
And finally, the dropdown CSS:
.dropdown-content {
display: none;
position: absolute;
background-color: #FFFFFF;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;}
.dropdown-content a {
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;}
.dropdown-content a:hover {background-color: #ddd;}
.dropdown:hover .dropdown-content {display: block;}
.dropdown:hover .dropbutton {background-color: #ddd;}
EDIT: To add further clarification, the correct html is present before the snippet, calling the classes etc. The issue I am having is that I cannot get my dropdown buttons to look the same as the rest of the navbar i.e the gradient set by the .navbar extends over the two buttons as well.
I have set colors in the .dropbutton class as otherwise these default to the light grey colour of the drop down menu.
the outcome I'm looking for is something similar to the navbar featured on polygon where by the buttons seem to adopt the how gradient color scheme until hovered over.