不会隐藏 outlook 电子邮件中的内容
Won't hide content in outlook email
我正在尝试制作适用于 Outlook 的响应式电子邮件模板。 outlook HTML 工作正常,响应式 HTML 也工作正常。
我在响应部分使用了媒体查询,但现在无论何时向 Outlook 发送电子邮件,内容都会重复。
我的HTML设置如下:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width initial-scale=1">
<style> //Media Queries are here </style>
</head>
<body>
<!--[if gte mso 12]>
//All of the Outlook HTML is held here
<![endif]-->
<!--[if gte mso 12]>
<div style="width:0px; height:0px; overflow:hidden; display:none;
visibility:hidden; mso-hide:all;">
<![endif]-->
//All of the none Outlook HTML is held here
<!--[if gte mso 12]></div><![endif]-->
</body>
</html>
我想要发生的是,每当向 outlook 发送电子邮件时,顶部部分将 运行,如果是任何其他客户端,则使用 HTML 的其他部分。
我知道这不是最好的方法,因为实际上我应该只显示和隐藏部分代码而不是整个代码,但这更容易组合在一起。
有趣的是,当我开始使用媒体查询而不是为所有分辨率声明相同的 VW 时,这才开始发生。
如有任何帮助,我们将不胜感激。
所以我解决这个问题的方法是将 style="mso-hide:all"
添加到第二个块中的每个标签上。
在您要为 Outlook 隐藏的部分中使用 mso-hide:all
,这会使该部分对 Outlook 特定客户端隐藏。
我正在尝试制作适用于 Outlook 的响应式电子邮件模板。 outlook HTML 工作正常,响应式 HTML 也工作正常。
我在响应部分使用了媒体查询,但现在无论何时向 Outlook 发送电子邮件,内容都会重复。
我的HTML设置如下:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width initial-scale=1">
<style> //Media Queries are here </style>
</head>
<body>
<!--[if gte mso 12]>
//All of the Outlook HTML is held here
<![endif]-->
<!--[if gte mso 12]>
<div style="width:0px; height:0px; overflow:hidden; display:none;
visibility:hidden; mso-hide:all;">
<![endif]-->
//All of the none Outlook HTML is held here
<!--[if gte mso 12]></div><![endif]-->
</body>
</html>
我想要发生的是,每当向 outlook 发送电子邮件时,顶部部分将 运行,如果是任何其他客户端,则使用 HTML 的其他部分。
我知道这不是最好的方法,因为实际上我应该只显示和隐藏部分代码而不是整个代码,但这更容易组合在一起。
有趣的是,当我开始使用媒体查询而不是为所有分辨率声明相同的 VW 时,这才开始发生。
如有任何帮助,我们将不胜感激。
所以我解决这个问题的方法是将 style="mso-hide:all"
添加到第二个块中的每个标签上。
在您要为 Outlook 隐藏的部分中使用 mso-hide:all
,这会使该部分对 Outlook 特定客户端隐藏。