[英]How do I remove the white margins along the sides of my HTML email?
這是我現在遇到的問題。 在Mac郵件中(在Gmail和Thunderbird中也可以看到),我的HTML電子郵件的左右兩側都有這些邊距: http : //cl.ly/image/3j133f393Y3M/Screen%20Shot%202013-06-26 %20at%201.22.04%20 AM.png
我的目標是像這樣的全幅背景: http : //cl.ly/image/1205093I1m34/Screen%20Shot%202013-06-26%20at%201.22.47%20AM.png
根據代碼,我的背景寬度似乎已設置為100%:
<html>
<title>AASU VCU</title>
<body style="margin:0px 0px 0px 0px; padding:0px 0px 0px 0px; font-family: Helvetica, Arial, san-serif; background-color:#fff" bgcolor="#000">
</body>
<table bgcolor="#b2151b" style="color:#fff;font-family:Helvetica,Arial,sans-serif;font-size:16px;line-height:26px;width:100%;margin:0;padding:0">
<table cellpadding="0" cellspacing="0" width="100%" bgcolor="#b2151b" style="padding:0 40px; color:#fff"; font-family="Helvetica,Arial,san-serif"; font-size:"16px"; line-height="25px"; table-layout="fixed">
<tbody>
<tr>
<td bgcolor="#b2151b" width="450" style="color:#fff;font-family:Helvetica,Arial,sans-serif;font-size:16px;line-height:26px">
<br>
<br>
<table cellpadding="0" cellspacing="0" width="450" bgcolor="#b2151b" border="0" rules="none" frame="border" align="center" style="color:#fff; font-family:Helvetica,Arial,sans-serif; font-size:16px;line-height:26px; border-width:0px 0px 0px 0px; background-color:#b2151b" >
<tbody>
<tr>
<td width="450" valign="top" bgcolor="#b2151b" style="color:#a7abb1;font-family:Helvetica,Arial,sans-serif;font-size:16px;line-height:26px">
<a style="border:none!important;color:#ffffff;text-decoration:none;border-bottom:1px solid #666"><img src="http://f.cl.ly/items/3M3W1U0W1o1P1s3u1Q0C/White_transparent.png" alt="AASU VCU" style="border:none"></a>
</td>
</tr>
</tbody>
</table>
我在瀏覽器中測試了代碼,無論我調整它的大小如何,背景似乎都能成功擴展到全寬。 我只有在郵件客戶端中才能看到這些邊距。 我想念什么?
我建議在第一個表格元素中包含“ border:0px”屬性。 我的經驗法則是,當我沒有設置邊距,填充和邊框時,將它們設置為0px。
祝好運。
另外,您的</body>
結束標記位於<body>
標記的正下方。 這也可能是一個問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.