Outlook.com邮件背景图片无法显示的技术咨询
邮件背景图Outlook.com加载失败的修复方案
问题根源分析
你的代码存在两处关键语法错误,导致Outlook.com无法正确解析背景图:
- VML标签闭合错误:
<v:fill>是自闭合标签,但后续额外添加了</v:fill>闭合标签,破坏了VML结构。 - 中文引号错误:
<v:fill>里的color="#ffffff”使用了中文双引号,而非英文双引号,导致属性解析失败。
修复后的完整代码
<tr class="module" data-id="B1" data-description="B1 Large email heading"> <td role="presentation" cellpadding="0" cellspacing="0" border="0" align="center" valign="top" style="max-width: 600px; border-collapse: collapse;" class=""> <!--[if gte mso 9]> <v:image xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style=" border: 0;display: inline-block; width: 600pt; height: 495pt;" src="https://picsum.photos/600/495" /> <v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style="border: 0;display: inline-block;position: absolute; width: 600pt; height:495pt;"> <v:fill opacity="0%" color="#ffffff" /> <v:textbox inset="0,0,0,0"> <![endif]--> <table align="left" border="0" cellpadding="0" cellspacing="0" width="100%" style="max-width:600px; mso-cellspacing:0px; mso-padding-alt:0px;"> <tbody> <tr> <td valign="top" align="left" style="background-image: url('https://picsum.photos/600/495'); background-position: bottom left; background-size:cover; background-repeat: no-repeat; max-width: 600px;text-align: left; font-size: 16px; line-height: 21px; color: rgb(100, 114, 127); padding: 5px 15px 5px 15px;" background="https://picsum.photos/600/495" width="600" height="495"> <h2 style="font-size:20px;font-weight:normal;margin:10px 0 0 0;">CEO INSIGHT</h2> <h2 style="color:#d11418;font-size:20px;font-weight:normal;margin:0 0 5px 0;">MATT JERSEY</h2> <p style="width:70%;">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas ut porta odio. In semper massa nec dictum aliquet. Phasellus dui nisi, faucibus a purus in, varius luctus elit. Praesent eleifend gravida pellentesque. </p> <p style="width:70%;">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas ut porta odio. In semper massa nec dictum aliquet. Phasellus dui nisi, faucibus a purus in, varius luctus elit. Praesent eleifend gravida pellentesque. </p> </td> </tr> </tbody> </table> <!--[if gte mso 9]> </v:textbox> </v:rect> </v:image> <![endif]--> </td> </tr>
额外优化建议
- 移除
<td>上重复的valign="top"属性,避免代码冗余。 - Outlook.com对
background-size:cover支持有限,若需完美适配,可使用固定尺寸的背景图,或调整VML的尺寸定义匹配图片比例。
内容的提问来源于stack exchange,提问作者Stepppo
相关产品推荐
相关产品推荐

