8 replies [Last post]
macazone
Offline
newbie
Carlisle, Cumbria. UK
Last seen: 16 years 37 weeks ago
Carlisle, Cumbria. UK
Joined: 2004-03-16
Posts: 2
Points: 0

Hi I would like to have 2 links on a html page I want both to have seperate colours when hovered over in the browser. I have tried but they both seem to act together not seperately. Can you help please?

.link1 {
font-family: Arial, Helvetica, sans-serif;
font-size: 10px;
color: #9966FF;
text-decoration: none;
}
a:hover {
font-family: Arial, Helvetica, sans-serif;
font-size: 10px;
color: #00FFFF;
text-decoration: none;
}
.link2 {
font-family: Arial, Helvetica, sans-serif;
font-size: 16px;
color: #006600;
text-decoration: none;
}
a:hover {
font-family: Arial, Helvetica, sans-serif;
font-size: 16px;
color: #FF0000;
text-decoration: none;

}

Tony
Tony's picture
Offline
Moderator
Brisbane
Last seen: 4 days 1 hour ago
Brisbane
Timezone: GMT+10
Joined: 2003-03-12
Posts: 5343
Points: 2964

Links

Hi macazone,
The final hover declaration would be overriding the first.
Try this

.link1 { 
font-family: Arial, Helvetica, sans-serif; 
font-size: 10px; 
color: #9966FF; 
text-decoration: none; 
} 
.link1:hover { 
font-family: Arial, Helvetica, sans-serif; 
font-size: 10px; 
color: #00FFFF; 
text-decoration: none; 
} 
.link2 { 
font-family: Arial, Helvetica, sans-serif; 
font-size: 16px; 
color: #006600; 
text-decoration: none; 
} 
.link2:hover { 
font-family: Arial, Helvetica, sans-serif; 
font-size: 16px; 
color: #FF0000; 
text-decoration: none; 
}
Hope that helps

macazone
Offline
newbie
Carlisle, Cumbria. UK
Last seen: 16 years 37 weeks ago
Carlisle, Cumbria. UK
Joined: 2004-03-16
Posts: 2
Points: 0

Links

Brilliant, thanks

rahul
Offline
newbie
Last seen: 16 years 34 weeks ago
Joined: 2004-04-02
Posts: 4
Points: 0

BIG PROBLEM .. plz

Hi tony...
i was here to search my problem with same code. i think u might help me.
from last few days i am struggling with that code actually this code dosent work in Netscape could you help me. my code is:

  A.white:link {
	color: #FFFFFF;
  	font-size: 12px;}
  		 
	A.white:visited {
	color: #FFFFFF;
	font-size: 12px;}
  
	A.white:hover  { 
	color: #FFFFFF; 
	font-weight:bold;
	font-size: 12px;}  

	
	A:link {
	color: #000000;
  	font-size: 12px;}
  		 
	A:visited {
	color: #000000;
	font-size: 12px;}
  
	A:hover  { 
	color: #000000; 
	font-weight:bold;
	font-size: 12px;} 

this works well in IE but, where i am using a class "white" that code dosent work in NN.

Tony
Tony's picture
Offline
Moderator
Brisbane
Last seen: 4 days 1 hour ago
Brisbane
Timezone: GMT+10
Joined: 2003-03-12
Posts: 5343
Points: 2964

Links

Hi rahul,
It's possible that the standard link style is overriding the white style.
Try switching the order so that your default link style comes before the class styles:

   
/* Default links*/ 
   A:link { 
   color: #000000; 
     font-size: 12px;} 
         
   A:visited { 
   color: #000000; 
   font-size: 12px;} 
  
   A:hover  { 
   color: #000000; 
   font-weight:bold; 
   font-size: 12px;} 
 
/* White styles */ 
A.white:link { 
   color: #FFFFFF; 
     font-size: 12px;} 
         
   A.white:visited { 
   color: #FFFFFF; 
   font-size: 12px;} 
  
   A.white:hover  { 
   color: #FFFFFF; 
   font-weight:bold; 
   font-size: 12px;}  

Hope that helps

rahul
Offline
newbie
Last seen: 16 years 34 weeks ago
Joined: 2004-04-02
Posts: 4
Points: 0

Links

Hi Tony

ive checked this too, but all are in vain....
still same problem....

what to do ???

Tony
Tony's picture
Offline
Moderator
Brisbane
Last seen: 4 days 1 hour ago
Brisbane
Timezone: GMT+10
Joined: 2003-03-12
Posts: 5343
Points: 2964

Links

Hi rahul,
Can you post a link, something must be wrong somewhere.

rahul
Offline
newbie
Last seen: 16 years 34 weeks ago
Joined: 2004-04-02
Posts: 4
Points: 0

Links

hi Tony
this is the link.
http://martinkirkham2.bpweb.net/WWRO/project01/join.php
here on left side ive a menu which displays well in IE but not in NN.
the CSS file is controlvkj.css
thanx

Tony
Tony's picture
Offline
Moderator
Brisbane
Last seen: 4 days 1 hour ago
Brisbane
Timezone: GMT+10
Joined: 2003-03-12
Posts: 5343
Points: 2964

Links

Hi rahul,
It looks the same to me in Netscape 7.1, Firefox 0.8 and IE6.
Try removing the browsers cache as the visited links may be causing your problem.

Hope that helps