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

anchor pseudo class

Status
Not open for further replies.

dexeloper

Programmer
Joined
Oct 26, 2004
Messages
162
Location
GB
can anyone tell me what's wrong with this:

a.kword5{font-family:Verdana,Arial,Helvetica,sans serif;font-size:8pt;color:#9900CC;text-decoration:none;cursor:hand;font-weight:500;}

a.kword5:visited{font-family:Verdana,Arial,Helvetica,sans serif;font-size:8pt;color:#9900CC;text-decoration:none;cursor:hand;font-weight:500;}

a.kword5:hover{text-decoration:underline;font-family:Verdana,Arial,Helvetica,sans serif;font-size:8pt;color:#990099;cursor:hand;font-weight:500;background-color:#FFFFFF;}

a.kword5:active{font-family:Verdana,Arial,Helvetica,sans serif;font-size:8pt;color:#9900CC;text-decoration:none;cursor:hand;font-weight:500;background-color:#FFFFFF;}

I'm not gettingany changes when I hover.
 
Set the style of :link also

a.kword5:link{font-family:Verdana,Arial,Helvetica,sans serif;font-size:8pt;color:#9900CC;text-decoration:none;cursor:hand;font-weight:500;}


Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)

zen.gif
 
that didn't make any difference
 
Your code actually works for me in IE6, Mozilla and Opera 7+. The only thing I found that was wrong was the last font type in font-family: sans serif should be sans-serif if you are looking for generic font type or placed in quotes "sans serif" if it is the actual name of the font. Also, try to simplify your code -- attributes that will not change with pseudo classes do not need to be repeated:
Code:
a.kword5, a.kword5:visited {
	font-family: Verdana,Arial,Helvetica,sans-serif;
	font-size: 8pt;
	color: #9900CC;
	text-decoration: none;
	font-weight: 500;
}

a.kword5:hover {
	text-decoration:underline;
	background-color:#FFFFFF;
}

a.kword5:active {
	text-decoration:none;
}
 
Tried that (point taken about simplifying code).
My link code is :


<a class='kword5' target='KAKwdTitles' title='view other titles under this keyword' onclick='subFormSch(2620)'> European Union</a>

And I'm not getting any hover changes.
 
You need an HREF for the hover to work

<a HREF="javascript: void()" class='kword5' target='KAKwdTitles' title='view other titles under this keyword' onclick='subFormSch(2620)'> European Union</a>


Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)

zen.gif
 
Actually, better syntax would say

<a HREF="javascript: 'subFormSch(2620)'" class='kword5' target='KAKwdTitles' title='view other titles under this keyword'> European Union</a>


Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)

zen.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top