电子邮件内部链接? [英] Internal link in email?

查看:171
本文介绍了电子邮件内部链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在电子邮件中插入内部链接?

How do I insert an internal link in an email?

这是我在浏览器中打开的HTML,将其复制粘贴到Gmail中,并将其发送给自己,并期望其内部链接正在工作:

Here's html I open in browser, copy-paste in gmail, send it to myself and expect its internal links to be working:

<html>
  <body>
    <p><a href="#Title1" title="Click to go to Title 1">Birds</a></p>
    <p><a href="#Title2" title="Click to go to Title 2">Trees</a></p>
    <p><a href="#Title3" title="Click to go to Title 3">Flowers</a></p>
    <h4 id="Title1">Birds</h4>
    <p> There are many different birds. There are... </p>
    <h4 id="Title2">Trees</h4>
    <p> Trees have many different colors and branches... </p>
    <h4 id="Title3">Flowers</h4>
    <p> The Lignum Vitae is the national flower of Jamaica... </p>
  </body>
</html>

修改

我发送以下内容给我自己:

I'm sending the following to my self:

<html>
  <body>
    <p><a href="#Title1" title="Click to go to Title 1">Birds</a></p>
    <p><a href="#Title2" title="Click to go to Title 2">Trees</a></p>
    <p><a href="#Title3" title="Click to go to Title 3">Flowers</a></p>
    <h4 id="Title1"><a name="Title1">Birds</a></h4>
    <p> There are many different birds. There are... HOWEVER, it should be noted that Gmail appears to override the default browser/HTML functionality with JavaScript (and inserts a prefix into the named anchor and corresponding href so as not to interfere with its web interface). Consequently it seems that Gmail will only scroll to the named anchor if it is currently out of view - if it is already visible then no scroll occurs. HOWEVER, it should be noted that Gmail appears to override the default browser/HTML functionality with JavaScript (and inserts a prefix into the named anchor and corresponding href so as not to interfere with its web interface). Consequently it seems that Gmail will only scroll to the named anchor if it is currently out of view - if it is already visible then no scroll occurs.</p>
    <h4 id="Title2"><a name="Title2">Trees</a></h4>
    <p> Trees have many different colors and branches... HOWEVER, it should be noted that Gmail appears to override the default browser/HTML functionality with JavaScript (and inserts a prefix into the named anchor and corresponding href so as not to interfere with its web interface). Consequently it seems that Gmail will only scroll to the named anchor if it is currently out of view - if it is already visible then no scroll occurs. HOWEVER, it should be noted that Gmail appears to override the default browser/HTML functionality with JavaScript (and inserts a prefix into the named anchor and corresponding href so as not to interfere with its web interface). Consequently it seems that Gmail will only scroll to the named anchor if it is currently out of view - if it is already visible then no scroll occurs.</p>
    <h4 id="Title3"><a name="Title3">Flowers</a></h4>
    <p> The Lignum Vitae is the national flower of Jamaica... HOWEVER, it should be noted that Gmail appears to override the default browser/HTML functionality with JavaScript (and inserts a prefix into the named anchor and corresponding href so as not to interfere with its web interface). Consequently it seems that Gmail will only scroll to the named anchor if it is currently out of view - if it is already visible then no scroll occurs. HOWEVER, it should be noted that Gmail appears to override the default browser/HTML functionality with JavaScript (and inserts a prefix into the named anchor and corresponding href so as not to interfere with its web interface). Consequently it seems that Gmail will only scroll to the named anchor if it is currently out of view - if it is already visible then no scroll occurs.</p>
  </body>
</html>

,链接不可点击。我做错了什么?

and links aren't clickable. What do I do wrong?

推荐答案

gmail 中,您将需要使用命名锚点: p>

In gmail you will need to use named anchors:

<a name="Title1">Birds</a>

正如您所料,不同的电子邮件客户端的工作方式不同。一些支持ID的内部链接;有的不一些支持两者。 AFAIK gmail只支持命名的锚点。请记住,可能会有一些电子邮件客户端根本不支持内部链接。

As you might expect, different email clients... work differently. Some support internal links to IDs; some don't; some support both. AFAIK gmail only supports named anchors. Bear in mind that there will likely be some email clients that won't support internal linking at all.

id h4 不是绝对必要的,因为命名的锚应该在大多数电子邮件客户端中工作。但是,没有任何理由不能尽我所能。以下内容在Gmail中适用于我:

The id in the h4 isn't strictly necessary since the named anchor should work in the majority of email clients. However, there is no reason not to have both as far as I can tell. The following works for me in Gmail:

<h4 id="Title1"><a name="Title1">Birds</a></h4>

然而,应该注意的是,Gmail似乎可以用JavaScript覆盖默认浏览器/ HTML功能(和在命名的锚和相应的href中插入一个前缀,以免干扰其Web界面)。因此,如果Gmail刚刚显示为,则 Gmail只会滚动到命名的锚点 - 如果已经可见,则不会出现滚动。

HOWEVER, it should be noted that Gmail appears to override the default browser/HTML functionality with JavaScript (and inserts a prefix into the named anchor and corresponding href so as not to interfere with its web interface). Consequently it seems that Gmail will only scroll to the named anchor if it is currently out of view - if it is already visible then no scroll occurs.

这篇关于电子邮件内部链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆