Search code examples
htmlemailhref

Same page link within email


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.


Solution

  • Try this now. :)

    <a href="#targetelement">quicklink</a>
    
    ...
    
    <a name="targetelement">Hello there</a>