View Full Version : Mouseover problem

05-13-2009, 07:22 PM
I got a script to change text from black to red when the mouse goes over it. It wirks ok but the problem is that it permantly changes the text to bold when I want the text to sttay regular. Can anyone fix this script for me as i am completely dumb when it comes to codes.
Here is the script:

a style="text-decoration: none" href="balls.htm" >
<font color="#000000" face="Georgia"><b onmouseout="this.style.color = 'black';" onmouseover="this.style.color = 'red';">SCHOOL BALLS</font></a></td>


Philip M
05-13-2009, 07:44 PM
<font color="#000000" face="Georgia"><b

delete the ><b which appears to be a typo error.

"A weak currency reflects a weak econony and a weak government". - Gordon Brown, now the UK Prime Minister, 1992.

Old Pedant
05-13-2009, 08:27 PM
I think the <b> was on purpose, but he forgot the </b> tag. In any case, it's a horrible mish-mash of styles and an obsolete <font> tag.

So cliean it up properly: move the JS events to the <A> tag. And use style in place of the <font> and <b> tags.

And not strictly necessary but a good idea: Put in some alternate fonts in case user doesn't have Georgia on his/her machine.

<a href="balls.htm"
style="text-decoration: none; color: black; font-family: Georgia, Verdana, sans-serif; font-weight: bold;"
onmouseover="this.style.color = 'red';"
onmouseout="this.style.color = 'black';"

p.s. to Philip: LOL on that quote!

Philip M
05-13-2009, 08:31 PM
font-weight: bold;

But the guy wants regular NOT bold! :cool:

font-weight: normal;

05-13-2009, 10:14 PM
Hi Old Pedant
Thanks very much, I took out the font families and left it on my default font which is Times New Roman and took out the bold bit and now it is working great.:thumbsup:

Old Pedant
05-14-2009, 12:56 AM
Teach me to read code, only, and not the question itself.

Anyway, glad it works.

rugrotts: It does NOT hurt to use font-family if you would like a special font to appear when possible. Just so long as you realize that if the font you specify isn't there then the browser will take your second choice, then your third, etc. And if it can't find any of your choices then it will use the default. So no harm just using font-family: Georgia; if you want. If the user doesn't have Georgia, it will default to the page font of Times New Roman.