Of course, sorry if I wasn't clear. First of all, did you apply the code to each individual element?
Maybe this example is more understandable:
css file:
Code:
.menu_item
{ background-color: Grey; }
.menu_item:hover
{ background-color: Blue; }
html file:
Code:
<section>
<a class="menu_item" href="/"> Home </a> <!-- Styles being applied to each link. -->
<a class="menu_item" href="/"> Home </a>
<a class="menu_item" href="/"> Home </a>
</section>
However, if your links are
inside other elements that represent each "box" in the menu, you would need to apply the hover style to those elements instead.
html file:
Code:
<ul>
<li class="menu_item"> <a href="/"> Home </a> </li> <!-- Styles applied to the containing element. -->
<li class="menu_item"> <a href="/"> Home </a> </li>
<li class="menu_item"> <a href="/"> Home </a> </li>
</ul>
There is a pitfall to beware in the above example. Although this would highlight the whole list item on mouseover, only the link element has functionality as a link. This means that you can mouseover the list item and it will highlight, giving the impression you can click and something will happen, but it will only work when your mouse is truly over the link! Consider you apply a background color to your link element — which I believe you mentioned — and it only has a section of color behind the text, that is the boundaries of the link. Clicking around the edges won't work, and it will only confuse people if the whole thing changes color when they mouseover.
The solution is to make your link elements block level elements, and use them similarly to my first html example.
The below css assumes the top html example in this post is the target html.
css file:
Code:
// We can make the link itself be the whole navigation item.
a.menu_item
{ display: block; // The only important part, the rest is for example.
width: 200px;
height: 40px;
border: 1px solid Black;
text-align: center;
padding: 10px;
background-color: Grey; }
a.menu_item:hover
{ background-color: Blue; }