【问题标题】:The "meta" and orientation detect doesn't work in iPhone/iPad mail?“元”和方向检测在 iPhone/iPad 邮件中不起作用?
【发布时间】:2012-07-02 10:06:26
【问题描述】:
  1. <meta name="viewport" content="width=600,initial-scale = 2.3,user-scalable=no"> 等元数据在 iPhone / iPad 邮件中不起作用?

  2. 如何检测 iPhone 邮件中的方向?

  3. 是否有任何关于 iPhone / iPad 邮件中的 HTML 和 CSS 的文档?

【问题讨论】:

  • 您是在谈论发送在不符合这些元标记的 iOS 设备上读取的 HTML 电子邮件吗?

标签: iphone html email orientation meta-tags


【解决方案1】:

您可以使用 CSS 3 媒体查询 来检测 iPhone / iPad 的方向。

<!-- css -->
@media only screen and (max-device-width: 1024px) and (orientation:portrait) { 
    .landscape { display: none; }
}
@media only screen and (max-device-width: 1024px) and (orientation:landscape) { 
    .portrait { display: none; }
}

<!-- example markup -->
<h1 class="portrait">Your device orientation is "portrait"<h1>
<h1 class="landscape">Your device orientation is "landscape"<h1>

【讨论】:

  • 您也可以修改它以与 iPhone 一起使用!纵向和横向方向有没有?使用max-device-width 到 320(640 用于视网膜显示)...
  • "你应该知道方向媒体查询,虽然在 iPad 上支持,但在 iPhone 上不工作" -- mislav.uniqpath.com/2010/04/targeted-css 像宽度和设备宽度这样的大小查询在 iPhone 上工作safari,但不适用于 iPhone 邮件内容...
猜你喜欢
  • 2011-10-06
  • 1970-01-01
  • 2011-03-20
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-05-09
  • 2012-09-19
  • 1970-01-01
相关资源
最近更新 更多