View Full Version : Need help with formatting the mailto: tag!!


ibii
08-15-2006, 03:32 AM
Ok, so I'm building a new layout and on my page there is a link to e-mail me. The code of this link is the following: <a href="mailto:e-mail">e-mail me</a> I believe this coding to be 100% correct. However, in my CSS stylesheet, I have my link codes set in such a way that there is no underline for my links and the links are a different color. CSS coding: (also the CSS is an external stylesheet, the link used in the document to link to the stylesheet is:
<LINK REL="Stylesheet" HREF="stylesheet.css"> which I also believe to be correct)

<style type="text/css">

A:link
{ text-decoration: none; color:#3399CC; }
A:visited
{ text-decoration: none; color:#3399CC; }
A:active
{ text-decoration: none; color:#3399CC; }
A:hover
{ text-decoration: none; color:#3399CC; }

.preElement
{
font-weight:bold;
color:#000066;
font-family:arial;
font-size: 10pt;
}

pre
{
font-weight:bold;
color:#000066;
font-family:arial;
font-size: 10pt;
}

body
{
font-weight:bold;
color:#000066;
font-family:arial;
font-size: 10pt;
}

td
{
font-weight:bold;
color:#000066;
font-family:arial;
font-size: 10pt;
}

</style>

Also, the mailto: link doesn't work on my page! Whenever I click the link, nothing happens. The link is inside a frame, and also adding target="_blank" to the mailto: tag doesn't make the link work, either. Adding text-decoration:none and the <font> tag to the individual link to try and change the style/color doesn't work either!! Can someone help me try to get my link a) working b) correct color and c) without underline? Help!

Also I am using the Firefox browser for this coding =)

General MJ
08-15-2006, 04:05 AM
your supposed to put your e-mail address in there: this is what i use:

<a href="mailto:customcopperandslate@comcast.net?subject=He llo">Customcopperandslate@comcast.net</a> Click to send us an e-mail!

the bold is what you can edit to make it fit your needs, the underlined material is not necessary, you could delete it if you wish the subject to be blank when the the user clicks on the link..

EDIT: hope that helps

ibii
08-15-2006, 06:55 AM
Yes, I am already using my e-mail address in the mailto tag!! Thank you, though, but the link still isn't working =)

J to the izzosh
08-15-2006, 01:02 PM
As far as styling goes, if your link is in a framed document, make sure that you reference your style sheet in that document (the one actually containing the link) and not only in the frames page. Also, if you are using an external style sheet, then you should remove the <style></style> elements from your CSS as they are HTML, not CSS, and will cause errors in how your style sheet is parsed.

Concerning the link not working, it is hard to determine the reason without seeing it in context. <a href="mailto:e-mail address">link text</a> is the correct format for a mailto link and should work fine. Be sure to check the surrounding HTML for syntax errors like unclosed tags as they may prevent the link from being presented properly.

ibii
08-15-2006, 04:56 PM
Thank you very much!! Removing the style tags does allow me to correctly change the color and style of the link. However! I was still having problems with getting the link to open correctly, but I've finally fixed it - I was just having a problem because the default mail client that I had set wasn't actually installed on my computer! So I changed it to the e-mail client that I actually do use and now everything is fine. Thanks guys!

J to the izzosh
08-15-2006, 05:07 PM
Ahhh, that makes sense. Really, the link was working, your computer just had nothing to open. Congrats.