Outlook 中 HTML 电子邮件的错误显示

问题描述

我有以下 HTML 电子邮件代码

<div style="background-color:red;max-width:600px;height:140px;margin-left:auto;margin-right:auto;">

<img src="https://via.placeholder.com/140x99" height="140" width="99" style="height:140px;width:99px;display:block;border:0;float:right;margin:0px;padding:0px;">

<p style="margin:0;font-size:30px;font-weight:700;padding-left:10px;margin-top:0px;padding-top:10px;">This is an important example header!</p>

</div>

我希望 HTML 能够像这样呈现:

enter image description here

文字在左侧,图片在右侧,与红色父元素高度相同。

我使用 Email On Acid 的所有 86 个电子邮件呈现器对此进行了测试。 HTML 代码在几乎所有电子邮件客户端上都能正确呈现。

但是在以下电子邮件客户端上显示错误

Outlook Office 356 (Windows 10)
Outlook 2007 (Windows 7)
Outlook 2010 (Windows 7)
Outlook 2013 (Windows 7)
Outlook 2016 (Windows 10)
Outlook 2019 (Windows 10)

我得到以下输出

enter image description here

你看,图片在左侧,文字图片下方。

我该怎么做才能使 Outlook 电子邮件客户端上的输出也正确?

解决方法

在图像上应用 df <- crimes[crimes$outcome_status_category == "Investigation complete; no suspect identified",] # extract dataframe with rows that match the criteria df$id # extract ids df$id[1:10] # extract first 10 ids

注意:我不能 100% 确定它是否会起作用,因为我目前无法访问关于 Acid 的电子邮件。

align="right"
,

我终于得到了这段代码,它也适用于 Outlook:

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width,initial-scale=1">
<style>
.dropbtn {
  background-color: #4CAF50;
  color: white;
  padding: 16px;
  font-size: 16px;
  border: none;
}

.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: #f1f1f1;
  min-width: 160px;
  box-shadow: 0px 8px 16px 0px rgba(0,0.2);
  z-index: 1;
}

.dropdown-content a {
  color: black;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
}

.dropdown-content a:hover {background-color: #ddd;}

.dropdown:hover .dropdown-content {display: block;}

.dropdown:hover .dropbtn {background-color: #3e8e41;}

.force-scroll {

overflow-y: scroll;

height: 200px;

}
</style>
</head>
<script>
</script>
<body>
 <table style="width:25%">
        <tr>
            <td valign= "top">
                <h3 id= "total">Orders for</h3>
        </td>
       <td>
<div class="dropdown force-scroll">
  <button id="month" class="dropbtn">Jan</button>
  <div class="dropdown-content">
    <a class="option" href="#" onclick="selected=Jan">Jan</a>
    <a class="option" href="#" onclick="selected=Feb">Feb</a>
    <a class="option" href="#" onclick="selected=Mar">Mar</a>
    <a class="option" href="#" onclick="selected=Apr">Apr</a>
    <a class="option" href="#" onclick="selected=May">May</a>
    <a class="option" href="#" onclick="selected=Jun">Jun</a>
    <a class="option" href="#" onclick="selected=Jul">Jul</a>
    <a class="option" href="#" onclick="selected=Aug">Aug</a>
    <a class="option" href="#" onclick="selected=Sep">Sep</a>
    <a class="option" href="#" onclick="selected=Oct">Oct</a>
    <a class="option" href="#" onclick="selected=Nov">Nov</a>
    <a class="option" href="#" onclick="selected=Dec">Dec</a>
  </div>
</div>
</td>
 </tr>
        </table>
</body>
</html>