3

I swear I had this working last week, but... Does anyone know how to get same-page hrefs working within an email? I'm using this format;

<a href="#targetelement">quicklink</a>

...

<div id="targetelement">Hello there</div>

Which works in a standard webpage naturally, but it doesn't do anything when viewed in an email client (tested in Thunderbird and Gmail so far). Is same-page linking even possible within an email? If not, are there alternative methods?

UPDATE:
Using an id actually does work in Thunderbird, unless the email has been forwarded, then it stops working. id doesn't work in Gmail, name doesn't work in either.

Mathew
  • 8,203
  • 6
  • 37
  • 59
  • If it doesn't work in a webmail viewer, you should probably check the source code it is actually sending to the browser. That might give you some insight into what the webmail viewer is actually doing to break your code (maybe it modifies or strips IDs, for example). As for desktop applications: you're probably out of luck as their HTML support can be rather sketchy. – Alan Plum Mar 10 '10 at 12:09

4 Answers4

3

Try this now. :)

<a href="#targetelement">quicklink</a>

...

<a name="targetelement">Hello there</a>
raj
  • 3,769
  • 4
  • 25
  • 43
0

That would wholly depend on the mail client (desktop or web based), different clients use different rulesets and engines for parsing and displaying email so there is no definitive answer.

code_burgar
  • 12,025
  • 4
  • 35
  • 53
  • 1
    Rather than say there isn't one answer for all, you could at least illustrate an answer to *one* of the clients mentioned in my question. – Mathew Mar 10 '10 at 11:55
  • @MatW: Since your question was not "How do I make this work in one of these two email clients?" but included wording like "tested in Thunderbird and Gmail **so far**" it did not seem that you wanted a quick fix for one of the available clients but an universal solution. – code_burgar Mar 10 '10 at 13:40
  • Fair enough, but then why take the time to type a non-answer? – Mathew Mar 10 '10 at 14:58
0

Why not try

<a href="#targetelement">quicklink</a>

...

<a name="targetelement" id="targetelement">Hello there</a>

In the same link, not nice - but might get it to work in several clients.

dikjones
  • 11
  • 1
0

This Code is Working Fine!.

<a href="#test">Lorem Ipsum</a>
<div id="test">
<a href="test" name="test" jumpthis="test">Lorem Ipsum</a>
</div>

Remove the jumpthis="test" and the link did not work in Outlook 2013.