我正在使用適用于每個郵件客戶端的HTML 模板。但是在Gmail中,布局被打破了。
這是它在gmail上的樣子:

這就是它在其他地方的樣子:

這是我的代碼:
<body>
<table role="presentation" width="615" align="left" border="0" cellpadding="0" cellspacing="0"
style="font-family: Arial, Verdana, sans-serif;">
<tr>
<td align="center"><a href="#" target="_blank"><img src="#" border="0" alt="Name" /></a></td>
</tr>
<tr>
<td>
<br>
<hr style="height:0.5px" color="#00aaff">
<div style="font-family:arial; font-size:12px;">
<table width="595" align="center" border="0" cellpadding="0" cellspacing="0"
style="font-size: 12px; font-family: Arial, sans-serif; color: #333333; line-height: 19px;">
<tr>
<td height="10" style="line-height: 1px;"> </td>
</tr>
<td valign="top">Some lorem ipsum random textum <br /><br /></td>
<td width="10" style="line-height: 1px;"> </td>
<td valign="top" align="right">
<table class="noMobile" cellpadding="0" cellspacing="12" border="0" bgcolor="#f3f3f3">
<td>
<table cellpadding="0" cellspacing="0" border="0"
style="font-family:Arial, Sans-Serif; font-size: 12px; color: #333333; line-height: 19px;">
<tr>
<td>
<font face="Arial, Helvetica, sans-serif" color="#555555" style="font-size: 14px;"><b>Test</b>
</font><br /><br /><br />
</td>
</tr>
<tr>
<td width="110"><b>[param2]:</b></td>
<td>[param3]</td>
</tr>
<tr>
<td><b>[param4]:</b></td>
<td>[param5]</td>
</tr>
<tr>
<td colspan="2" nowrap="nowrap" style="color: #00aaff"><br /><br />
<b>Text line 1<br />Text line 2 <br />Text line 3 <br /> Text line 4. <br />Text line 5 <br />Text line
6.</b>
</td>
</tr>a
</table>
</tr>
</td>
</table>
</td>
</td>
</tr>
</table>
<hr style="height:0.5px" color="#00aaff">
<p>test template random text lorem ipsum donesum weirdsum</p>
</body>
我已經嘗試了一切 - 包括改變min-width或max-width改變viewport但它仍然壞了。誰能幫我?
uj5u.com熱心網友回復:
看起來您缺少很多結束 HTML 標記。這可能會導致您的布局中斷。
看更多:
- 瀏覽器會自動插入缺失的 HTML 標簽嗎?
- HTML中不關閉標簽和屬性的實際問題是什么
- 如果我們不添加結束標簽會怎樣?
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/535869.html
