隐藏Apple Mail上的HTML邮件中的元素

时间:2014-06-10 08:57:25

标签: html email html-email email-client

Apple邮件客户端(桌面操作系统和iOS上的Apple Mail)是否有办法在HTML邮件中隐藏元素(例如s或s)?

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

2 个答案:

答案 0 :(得分:0)

我认为您可以使用媒体查询来执行此操作,这里有一些额外的代码。然后通过显示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)" />

答案 1 :(得分:0)

是的,但仅适用于iOS设备。 Here's a full list.

然而,通过媒体查询尝试检测桌面Mac几乎是不可能的。大多数iMac的显示器为1920x1080,与所有1080p显示器相同。您的笔记本电脑也会遇到同样的问题。并且您无法在电子邮件中使用javascript,因此无法通过浏览器嗅到这种方式。

最重要的是,Apple Mail并不像GMail和雅虎这样的网络邮件服务那么受欢迎,因为它会剥夺任何媒体查询。