我正在处理 html 电子邮件,其中我使用 html 和内联样式复制了一个设计。
在 outlook 中,我看到了以下设计:
fiddle 设计:
附件是fiddle因为我已经提到了我所有的 html 和内联样式。 在fiddle , 与上面的设计 (Outlook) 相比,我得到了不同的设计。
问题陈述:
我想知道我应该对 fiddle 的内联样式做哪些更改,以便 fiddle 和上面的屏幕截图(outlook)中的设计看起来相同。
与 fiddle 中的设计相比,outlook 屏幕截图中 Steps to earn your money 文本下方的空间太大。我在该部分中使用的代码片段是:
<tr>
<td>
<table cellpadding="0" cellspacing="0" border="0" width="100%" style="padding-left:15%;padding-bottom:25%;">
<tr>
<td>
<h2 style="text-align: left;
padding-left: 19%;
color: #484848;
padding-top: 2.5%;
padding-bottom: 5%;
padding-right: 12%;">steps to earn your money:</h2>
</td>
</tr>
<tr style="text-align:left;color:#484848;font-size:20px;">
<td>
1. click here to open the XYZ app to the posting requests page<br><br>
2. click on availability check request<br><br>
3. say yes, its availabile ot suggest another date it is<br><br>
4. wait the 1 or 24 hour confirmation good<br><br>
5. three days after the booking ends money will be send to your account<br><br>
</td>
</tr>
</table>
最佳答案
快速检查了您的代码,这是我发现的:
- 您在第 17 行和第 18 行交换了 td 和 tr(正如上面提到的 Jason)
- 您正在使用百分比形式的填充(第 55 行 i 已修复)。这不是一个好主意,为了安心,请保持像素。其他地方也改为像素。
<html>
<body>
<table cellpadding="0" cellspacing="0" border="0" width="800" class="mobile" align="center">
<tr>
<td>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td style="padding-left:6%;padding-bottom:5%;font-size:20px;color:#55BEC7;"> hi ABC,</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table cellpadding="0" cellspacing="0" border="0" width="100%" style="font-size:20px;padding-left:5%;">
<tr>
<td style="padding-bottom: 3%;text-align:right;">type:</td>
<td style="padding-bottom: 3%;padding-left: 10%;">availability check request</td>
</tr>
<tr>
<td style="padding-bottom: 3%;text-align:right;">estimated total:</td>
<td style="padding-bottom: 3%;padding-left: 10%;">$250.00</td>
</tr>
<tr>
<td style="padding-bottom: 3%;text-align:right;">what</td>
<td style="padding-bottom: 3%;padding-left: 10%;">chainsaw</td>
</tr>
<tr>
<td style="padding-bottom: 3%;text-align:right;">how many</td>
<td style="padding-bottom: 3%;padding-left: 10%;">2</td>
</tr>
<tr>
<td style="padding-bottom: 3%;text-align:right;">when:</td>
<td style="padding-bottom: 3%;padding-left: 10%;">Mar 28/18 @ 7:00pm to <br> Mar 30/18 @ 7:00pm</td>
</tr>
<tr>
<td style="padding-bottom: 3%;text-align:right;">who:</td>
<td style="padding-bottom: 3%;padding-left: 10%;color:#FF8D58;">John s</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table cellpadding="0" cellspacing="0" border="0" width="100%" style="padding-left:15%;padding-bottom:25%;">
<tr>
<td>
<h2 style="text-align: left;
padding-left: 20px;
color: #484848;
padding-top: 30px;
padding-bottom: 20px;
padding-right: 20px;">steps to earn your money:</h2>
</td>
</tr>
<tr style="text-align:left;color:#484848;font-size:20px;">
<td>
1. click here to open the XYZ app to the posting requests page<br><br>
2. click on availability check request<br><br>
3. say yes, its availabile ot suggest another date it is<br><br>
4. wait the 1 or 24 hour confirmation good<br><br>
5. three days after the booking ends money will be send to your account<br><br>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
希望这对您有所帮助。
关于html - 与其他电子邮件客户端相比,电子邮件设计在外观上看起来有所不同,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51003595/