Forum Moderators: not2easy

Message Too Old, No Replies

Menu with changes in the hover state only

         

mandy74

8:14 am on Jun 8, 2005 (gmt 0)



Hi everybody, i have a question about the hover state:

If i create a class for a menu in this way:

.sottomenu{
font-size: 9px;
COLOR: #8B8989;
text-decoration: none;
font-weight: bold;
text-transform: uppercase;

}

Then i go and create the link for this class:

A.sottomenu:link{font-size: 9px; COLOR: #8B8989; text-decoration: none;}
A.sottomenu:visited{font-size: 9px; COLOR: #8B8989; text-decoration: none;}
A.sottomenu:active{font-size: 9px; COLOR: #8B8989; text-decoration: none;}
A.sottomenu:hover{font-size: 9px; COLOR: #F18AAF; text-decoration: none; }

Now, imagine that i have lots of sottomenu classes all different coloured just in their hover state, i have create all these different styles everytime? Even if the only thing would change is the hover state?

Or is there a fastwest way?
I hope to have explained the problem clearly :)
Thanks!

ChadSEO

9:38 pm on Jun 8, 2005 (gmt 0)

10+ Year Member



Assuming I understand what your saying:
You have several different classes for different types of links. Within these classes, the only difference is in the :hover state. If I got that right, then all you really need for each class is...
.sottomenu{
font-size: 9px;
COLOR: #8B8989;
text-decoration: none;
font-weight: bold;
text-transform: uppercase;
}

A.sottomenu:hover{ COLOR: #F18AAF; }


Setting the style on the class automatically sets it for :link, :visited, :active, and :hover, so you only need to set values that are different. Does that make sense?