我正在使用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>
有什么办法在电子邮件中显示文本而不是图像吗?
谢谢
发布于 2021-10-05 01:05:02
Windows上的Outlook不支持背景图像。但是您可以使用VML来模仿该功能。如果您希望将背景应用于整个窗口,则代码应如下所示:
<div style="background:0 0/cover;background-image:url('https://www.example.com/image.jpg');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="https://www.example.com/image.jpg" color="#ffffff"/>
</v:background>
<![endif]-->
<div>CONTENT <br/> More Content</div>
</div>
此外,更喜欢链接到托管图像,而不是在Base64中嵌入图像。您可以在Caniemail.com上的background-image和Base64 Images电子邮件客户端中查看详细的支持。
发布于 2021-10-05 05:30:14
Word (用于在Outlook中呈现电子邮件)不支持正文中的背景图像。试着用桌子代替。
https://stackoverflow.com/questions/69447223
复制