Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

a:hover in CSS 2

Status
Not open for further replies.

blues77

Programmer
Jun 11, 2002
230
CA
I'm trying to apply the a:hover definition in my CSS and specifying a class for it. Right now I have
A.mainlinks:hover {COLOR: #993300; TEXT-DECORATION: underline}

this doesn't seem to be working. If you have any suggestions i would greatly appreciate them.

thanks
 
This should work for all links:

a:link {color:eek:range; text-decoration:underline; font-weight: bold}
a:visited {color:eek:range; text-decoration:underline; font-weight: bold}
a:active {background:black}
a:hover { background:red; text-decoration:none;}

<A href=yourpage.htm>your link</A>

This should work for links with classname 'mylink':

a.mylink:link {color:red; text-decoration:none; font-weight: bold}
a.mylink:visited {color:red; text-decoration:none;}
a.mylink:active {background:yellow}
a.mylink:hover { background:red; text-decoration:underline;}

<A class=&quot;mylink&quot; href=yourpage.htm>your link</A>

Hope this helps,
Erik <!-- My sport: Boomerang throwing !!
This year I will participate at the World Championships in Germany. (!! Many Happy Returns !! -->
 
Here is an example of a style I use:

.bigtitle A:link {font-family: &quot;Comic Sans MS&quot;, &quot;Arial&quot;, sans-serif;
text-align: right;
text-decoration: none}

.bigtitle A:visited {font-family: &quot;Comic Sans MS&quot;, &quot;Arial&quot;, sans-serif;
text-align: right;
text-decoration: none}

.bigtitle A:hover {font-family: &quot;Comic Sans MS&quot;, &quot;Arial&quot;, sans-serif;
color: #FFFFFF;
text-align: right;
text-decoration: underline}

Just do the hover style the same way you do the link, etc... style for the A tag.
Good luck!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top