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!

Link font and color problem

Status
Not open for further replies.

abkdefz

MIS
Mar 8, 2009
2
Can anyone tell me, where I am going wrong with this Javascript. It is a 'refer a friend-script'. I want the link text to appear in Trebuche MS, size 12, normal. Also the link (both active, hover and used link) should appear white. How can it be done?

Best regards

Tonny Surrow



<STYLE TYPE="text/css">
<!--
p {font: italic bold 14pt "Trebuche MS";}
a{text-decoration:none}
A:link {color: white}
A:hover { color:white }
//-->
</style>



<script language="javascript" type="text/javascript">

function doMail()
{
var loc = location.href
window.location = "mailto:?body="+loc
}

</script>
<a href="mailto:you@yours.com" onclick="doMail();return false">
Tip en ven</a>
 
You're missing a "t" from your font name:

Code:
p {font: italic bold 14pt "Trebuche[!]t[/!] MS";}

But also be aware you're styling a P which doesn't exist instead of the anchor, and you're also giving bold and 14pt when you want non-bold and 12pt.

You might also find that your JS doesn't work as the location may not change before your JS runs, so best to pass 'this.href' into your function instead.

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
Thanks, Dan :) That helped me a lot. I have got the JS up and functioning right now. It hepled, that you reminded me of the T in Trebuchet. It is probably a french word with a mute t.

I did something else too. I removed the css part from the javascript and placed it in the html pages head section. By doing that it controls the appearance of all javascript fonts and links.

Thanks again.

Tonny

<head>
<style type="text/css">
A{font:normal 10pt "Trebuchet MS";}
A:link {text-decoration: none; color: white;}
A:visited {text-decoration: none; color: white;}
A:active {text-decoration: none; color: white;}
A:hover {text-decoration: none; color: white;}
</style>
</head>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top