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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Please, How Can I do for have two A hover behaviors at the <body>?

Status
Not open for further replies.

ejgarcia

IS-IT--Management
May 28, 2003
72
0
0
US
Hi all,

I'm developing a website and I wrote at the <head> a ccs stile. which is a white color for the links and the a:hover other color effect.
But it behavior it still in all hyperlinks i have in the site. for example:

<STYLE type=&quot;text/css&quot;>BODY {
A {
COLOR: white; TEXT-DECORATION: none
}
A:hover {
COLOR: #990000; TEXT-DECORATION: none
}
</style>

How can I do if I want to have another hyperlink with another kind of color and other kind of a:hover color in the same page?

Thanks
 
define a class for the link
<a class=&quot;leftnav&quot; href=&quot;somethinghere&quot;> a link </a>


then on your stylesheet

a.leftnav{
whatever you need
}

a.leftnav:hover{
some other definition
}



grtfercho çB^]\..
&quot;Imagination is more important than Knowledge&quot; A. Einstein
 
You need to tell it what you what.
Then you need to call it from the link.
I think Netscape is case sensitive.


<style>
a.red {
font-family: Arial, Helvetica, sans-serif;
font-size: 12pt;
color: #990000;
font-weight: bold;
text-decoration:none;
}
a:hover.red {
font-family: Arial, Helvetica, sans-serif;
font-size: 12pt;
color: #660066;
font-weight: bold;
text-decoration:underline overline;
background : #FFCCCC;
}
a.blue {
font-family: verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 8pt;
color: #0000CC;
font-weight: normal;
text-decoration:none;
}
a:hover.blue {
font-family: verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 8pt;
color: Black;
font-weight: normal;
text-decoration:underline overline;
background: #FFFFCC;
}
</style>


<a class=&quot;red&quot; href=&quot;pagename&quot;>red link</a>
<a class=&quot;blue&quot; href=&quot;pagename&quot;>blue link</a>


HTH
Michael
 
Hi Michael,

Thanks a lot, it really works just like I wanted!!

Eduard.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top