android - Autofit gmail 应用程序,电子邮件设计

标签 android css email gmail

我在设计电子邮件时遇到了 Android 和 iPhone 中 gmail 应用程序的自动调整功能的问题。

该电子邮件在其他客户中表现良好。

为了防止自动,到目前为止我已经尝试过:

  • 在表格/包装器上设置最大宽度和最小宽度
  • 像这样添加元视口(viewport):

    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
    

这些都不起作用。

你有什么想法吗?

最佳答案

我遇到了同样的问题。我添加了 min-width,不仅是表格,还有列 (td) 标签。这似乎覆盖了 Gmail 的自动调整功能。

下面是我如何实现它的示例。我从这个论坛找到了答案:https://www.emailonacid.com/forum/viewthread/566/#827

<table width="590" height="900" border="0" cellpadding="0" cellspacing="0" style="margin:0 auto; min-width:590px;">
  <tr>
    <td style="font-size: 1px; line-height: 1%; mso-line-height-rule: exactly; min-width:295px;">
      <a href="#">
        <img style="display:block;border:0px;line-height:50%;" src="example.jpg" width="295" height="900" alt="">
      </a>
    </td>
    <td style="font-size: 1px; line-height: 1%; mso-line-height-rule: exactly; min-width:295px;">
      <a href="#">
        <img style="display:block;border:0px;line-height:50%;" src="example.jpg" width="295" height="900" alt="">
      </a>
    </td>
  </tr>
</table> 

如您所见,我将表格的最小宽度设置为 590px;每列 (td) 的最小宽度为 295px。与图像大小相同。

关于android - Autofit gmail 应用程序,电子邮件设计,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20355321/

相关文章:

python - 如何在 django email_user 中将 content_subtype 更改为 html

python - 从 Python 中的 message_from_string() 获取发件人地址

android - 使用适用于 iO、Android 和 Windows Phone 的 Xamarin

java - 如何将 fragment 逻辑从 MainActivity.java 中分离出来

html - 如何剪辑文本不溢出 CSS 上的以下组件?

javascript - 创建一个在红色和绿色之间变化的按钮

python - 如何在 python 中使用 cron 和 smtp 安排在特定时间发送电子邮件?

android - Android项目中应该使用Dagger进行单元测试吗?

java - 如何解析 JSON 中的 JSON

html - 如何显示应该溢出父容器的元素?