简体   繁体   English

HTML电子邮件内部链接在Outlook和Gmail移动应用中不起作用

[英]HTML Email Internal link not working in Outlook and Gmail mobile app

It's painful while designing HTML email. 设计HTML电子邮件时很痛苦。 I have added back to top link in my HTML email in following format. 我在HTML电子邮件中以以下格式添加了返回页首的链接。

<!-- Define top -->
<a name="top" id="top"></a>

<!-- Display Link to top -->
<a href="#top">Back to Top</a>

This works in outlook desktop app, but not working on mobile. 这适用于Outlook桌面应用程序,但不适用于移动设备。 Is there any way of make it working. 有什么办法可以使其正常工作。

This works just fine in Outlook 2013, IOS and Gmail. 在Outlook 2013,IOS和Gmail中可以正常工作。 I ran a test just to see what might happen and posted the code: 我运行了一个测试,只是为了查看可能发生的情况并发布了代码:

Going down the email: 查看电子邮件:

<a href="#C4">Jump to Chapter 4</a> <a name="C4"></a>

Going to the top: 转到顶部:

<a name="top"></a> <a href="#top">Jump to Top</a>

There's a few caveats working with internal hrefs. 有一些关于内部href的警告。

First off, you need email document length for the page to move. 首先,您需要电子邮件文档的长度才能移动页面。 In Gmail, it would not work until I made the window smaller. 在Gmail中,只有将窗口缩小后才能使用。

You need enough document room below the a name for at the bottom to work. 您需要在a name下方有足够的文档空间,以便底部工作。 If the a name is on the bottom line, unless you add space below it, the page will not move. 如果a name位于底行,除非您在a name下方添加空格,否则该页面将不会移动。

The <a name> and the <a href> are case sensitive. <a name><a href>区分大小写。 If they don't match, it will never work. 如果它们不匹配,它将永远无法工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM