【发布时间】:2021-10-05 08:35:20
【问题描述】:
我正在使用 Microsoft Flow 发送一封应以图片为背景的电子邮件。所以我创建了以下代码
<html> <body> <div style="width:100%, heith:100%">
<div style= "position:fixed ; width:500px; height=500px; top:1%; left:1%; ">
<img src="data:image/jpeg;base64,@{outputs('GifFile')?['body']['$content']}" alt="My Background" width="500" height="600"> </div>
<div style= "position:fixed ; top:5%; left:5%; ">
CONTENT <br/> More Content </div>
</div>
</body>
<html> <body>
但在 Outlook(对于 Microsoft 365)中,它仍会在图片下显示文本,如果我将消息源保存为 html 文件 - 它会在图像上显示文本,正如预期的那样。
还尝试了另一个代码:
<html> <head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body>
<div style="background:0 0/cover;background-image: url('data:image/jpeg;base64,R0lGODlhAwG2APeL ** Image code in here ** IBLAJCAA7') ;background-repeat:repeat;background-color:#ffffff;background-position:center;">
<!--[if mso]>
<v:background xmlns:v="urn:schemas-microsoft-com:vml" fill="true">
<v:fill type="tile" src='data:image/jpeg;base64,R0lGODlhAwG2APeL ** Image code in here ** IBLAJCAA7' color="#ffffff"/>
</v:background>
<![endif]-->
<div>CONTENT <br>
More Content</div>
</div>
</body>
</html>
任何想法如何在电子邮件中的图像上显示文本?
谢谢
【问题讨论】:
-
欢迎来到 HTML 邮件开发。如果要支持 Outlook,则必须使用表格。那里不支持 90% 的 HTML / CSS 内容。最好获得一个框架来创建您的 HTML 邮件。 mjml.io 类似这样的东西。
-
请注意,
<br>标签不使用也不需要结束斜线,并且在任何 HTML 规范中都没有。
标签: html outlook background-image html-email