【发布时间】:2014-06-10 08:57:24
【问题描述】:
当 Apple 邮件客户端(桌面操作系统和 iOS 上的 Apple Mail)查看 HTML 邮件中的元素(例如 s 或 s)时,有没有办法隐藏它们?
也许有一个通过 CSS 的 -webkit 属性的简单方法?
【问题讨论】:
标签: html email html-email email-client
当 Apple 邮件客户端(桌面操作系统和 iOS 上的 Apple Mail)查看 HTML 邮件中的元素(例如 s 或 s)时,有没有办法隐藏它们?
也许有一个通过 CSS 的 -webkit 属性的简单方法?
【问题讨论】:
标签: html email html-email email-client
我认为您可以使用媒体查询来做到这一点,这里有一些额外的代码。然后通过使用显示 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 设备。 Here's a full list.
但是,尝试通过媒体查询检测桌面 Mac 几乎是不可能的。大多数 iMac 的显示屏为 1920x1080,与所有 1080p 显示器相同。他们的笔记本电脑也会有同样的问题。而且您不能在电子邮件中使用 javascript,因此无法以这种方式进行浏览器嗅探。
最重要的是,Apple Mail 不像 GMail 和 Yahoo 等网络邮件服务那样受欢迎,后者会剥离任何媒体查询。
【讨论】: