My code so far is simple but I'm not sure how to overwrite the default background-color I have set for this class. the necessary html:
<!--
<div class="navbar" id="navbar">
<a href=""><img src="./Images/Hogwarts_Crest.png" alt="Welcome Home" id="home_image"></a>
<ul class="navbar">
<li class="Hufflepuff"><a href="">Browse</a></li>
<li class="Gryffindor"><a href="">Submit</a></li>
<li class="Ravenclaw"><a href="">Profile</a></li>
<li class="Slytherin"><a href="">Settings</a></li>
</ul>
</div>
and the css that goes with it:
.Hufflepuff {
background-color: rgba(255, 255, 0, 1);
color: Black;
}
.Gryffindor {
background-color: rgba(255, 0, 0, 1);
color: rgb(255, 215, 0);
}
.Ravenclaw {
background-color: rgba(0, 0, 255, 1);
color: rgb(205, 157, 50);
}
.Slytherin {
background-color: rgba(80, 200, 120, 1);
color: rgb(211, 211, 211);
}
.Hufflepuff a {
color: Black;
}
.Gryffindor a {
color: rgb(255, 215, 0);
}
.Ravenclaw a {
color: rgb(205, 157, 50);
}
.Slytherin a {
color: rgb(211, 211, 211);
}
.Hufflepuff a:hover {
background-color: rgba(255, 255, 0, 0.5)
color: Black;
}
.Gryffindor a:hover {
background-color: rgba(255, 0, 0, 0.5)
color: rgb(255, 215, 0);
}
.Ravenclaw a:hover {
background-color: rgba(0, 0, 255, 0.5)
/*text color is bronze*/
color: rgb(205, 157, 50);
}
.Slytherin a:hover {
background-color: rgba(80, 200, 120, 0.5)
color: rgb(211, 211, 211);
}
The idea here is that there is a horizontal navigation bar at the top of the screen. Each button has it's own background and text color. When the mouse hovers over a button, I want the alpha decreased by .5 on the background-color.
From what I can tell, the class selector is automatically considered priority over class selector + tag selector (e.g. ".Hufflepuff" takes priority over ".Hufflepuff a"), how do I overcome that?
What I have tried:
I tried rearranging the order so that the :hover selector was at the top, but it didn't help.