在Apple Mail上隐藏html邮件中的元素



是否有一种方法来隐藏元素(例如s或s)在html邮件中,当他们被苹果邮件客户端(苹果邮件在桌面操作系统和iOS)查看?

也许有一个简单的方法通过CSS的-webkit属性?

我认为您可以使用媒体查询来做到这一点,这里是一些额外的代码。然后通过使用display none或block,你可以隐藏元素。我希望你注意到媒体的提问。

 <!-- iPhone standard resolution 320x460  (landscape not needed because all web apps start portrait on iPhone) -->
<link  rel="apple-touch-startup-image" href="splash-320x460.jpg" media="(device-width: 320px)" />
<!-- iPhone high resolution (retina) 640x920 pixels (landscape not needed because all web apps start portrait on iPhone) -->
<link rel="apple-touch-startup-image" href="splash-640x920.jpg" media="(device-width: 320px) and (-webkit-device-pixel-ratio: 2)" />
<!-- iPad Portrait 768x1004 -->
<link rel="apple-touch-startup-image" href="splash-768x1004.jpg" media="(device-width: 768px) and (orientation: portrait)" />
<!-- iPad Landscape 748x1024 (yes, a portrait image but with content rotated 90 degrees - allows 20px for status bar) -->
<link rel="apple-touch-startup-image" href="splash-748x1024.jpg" media="(device-width: 768px) and (orientation: landscape)" />
<!-- iPad retina Portrait 1536x2008 -->
<link rel="apple-touch-startup-image" href="splash-1536x2008.jpg" media="(device-width: 768px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 2)" />
<!-- iPad retina Landscape 1496x2048 (yes, a portrait image but with content rotated 90 degrees - allows 40px for status bar) -->
<link rel="apple-touch-startup-image" href="splash-1496x2048.jpg" media="(device-width: 768px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 2)" />

可以,但只适用于iOS设备。以下是完整的列表。

然而,几乎不可能通过媒体查询来检测桌面Mac。大多数imac的显示器都是1920x1080,和所有1080p显示器一样。他们的笔记本电脑也会有同样的问题。你不能在电子邮件中使用javascript,所以没有办法通过这种方式进行浏览器嗅探。

最重要的是,Apple Mail不像GMail和雅虎这样的网络邮件服务那样受欢迎,后者会删除任何媒体查询。

最新更新