如何修复HTML电子邮件中的图像填充和间距?

问题描述

我正在处理HTML电子邮件模板。图像下方有一个小间距,我无法摆脱它。而这个空间是由DOCTYPE引起的。

Sample Image

我尝试了所有可能的方法,例如:

  • 为图像添加style =“ display:block”。
  • 将“ Align”属性设置为“ absmiddle”,“ absbottom”,“ texttop”,“ middle”,“ left”,“ right”和“ top”。
  • 通过将图像放置在div中,将“行高”设置为10px或更小。
  • 将“字体大小”设置为2px或更小。
  • 使用Float:Left或Float:Right。

但是似乎没有什么对我有用。有人可以帮我解决这个问题吗?

过去两天我一直在努力解决问题:P

我已附上以下示例代码

<div style="background:#ffffff;background-color:#ffffff;margin:0px auto;max-width:600px;">
    <table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="background:#ffffff;background-color:#ffffff;width:100%;">
       <tbody>
         <tr>
          <td style="direction:ltr;font-size:0px;padding:0px;text-align:center;">
          <table role="presentation" border="0" cellpadding="0" cellspacing="0"> 
          <tr>
            <td class="" style="vertical-align:top;width:600px;">
              <div class="mj-column-px-600 mj-outlook-group-fix" style="font-size:0px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;">
                <table border="0" cellpadding="0" cellspacing="0" role="presentation" style="vertical-align:top;" width="100%">
                  <tr>
                    <td align="center" style="font-size:0px;padding:0px;word-break:break-word;">
                      <table border="0" cellpadding="0" cellspacing="0" role="presentation" style="border-collapse:collapse;border-spacing:0px;">
                        <tbody>
                          <tr>
                            <td style="width:600px;">
                              <a href="#">
                                <img src="./assets/img/[email protected]" style="border:0;display:block;outline:none;text-decoration:none;height:auto;width:100%;font-size:13px;" />
                              </a>
                            </td>
                          </tr>
                        </tbody>
                      </table>
                    </td>
                  </tr>
                </table>
              </div>
            </td>
          </tr>
         </table>
       </td>
     </tr>
   </tbody>
 </table>
</div>

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)