HTML电子邮件列宽更改与不同的电子邮件客户端

时间:2012-09-14 14:41:36

标签: html html-table width html-email

我找不到这方面的直接答案,所以如果以前有人问过,请耐心等待。

我的HTML体验有限。在Android手机上的Entourage和Gmail中打开时,电子邮件中表格列的宽度会发生变化。我的电脑上的Gmail看起来不错,Outlook,雅虎等也很棒。

基本上发生的是Entourage / Gmail-droid中左右列切换的宽度。左列宽保持在width="401";右列保持固定在width="171"(它们交换左侧列为171,右侧为401 )。

我正在使用嵌套表在线选择的HTML电子邮件模板。这是删除文本和图像的基本代码。任何帮助将不胜感激:

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <style type="text/css" media="screen">
    html {
        -webkit-text-size-adjust:none;
        -webkit-background-size:100%;
    }

    .bold {
       color: #61BB46;
    }

    .Main {
           font-family: Verdana, Helvetica, sans-serif;
           font-size: 12px;
           line-height: 22px;
           color: #666666;
    }

    .Sidebar {  
           font-family: Verdana, Helvetica, sans-serif;
           font-size: 12px;
           line-height: 22px;
           color: #666666;
    }

    a:link {
           COLOR: #592989;
    }

    a:visited {
           COLOR: #FAAB53;
    }

    a:hover {
           COLOR: #61BB46;
    }

    a:active {
           COLOR: #592989;
    }

    </style>

    <body bgcolor="#ffffff" text="#666666" style="padding:0px; margin:0px;">
    <table style="font-family: Verdana, Helvetica, sans-serif; color: #666666; 
    font-size: 12px; Line-height: 18px; width: 600px;" border="0" cellspacing="0" 
    cellpadding="0" align="center">
        <tr>
          <td style="font-size: 30px; line-height: 32px; color: #592989;" colspan="4">
            <div style="font-size: 12px; color:#999;"></div></td>
        </tr>
        <tr>
          <td style="padding-top: 20px;" colspan="4"><table border="0" cellspacing="0" 
    cellpadding="0" align="center">
              <tbody>
                <tr>
                  <td style="padding: 4px; background-color: #e3dede;"><img src="" 
    width="578" height="190"></td>
                </tr>
              </tbody>
            </table></td>
        </tr>
        <tr>
          <td style="padding-top: 20px; padding-bottom: 20px; text-align: left;" 
    colspan="4"><p><a href="" target="_blank">
          </td>
        </tr>
        <tr>
          <td rowspan="5" width="401" valign="top"><p style="color: #592989; 
    font-size: 20px;"></p>
            <p class="Main" style="margin-bottom: 1.0em">
           </p></td>
          <td rowspan="5" width="19" valign="top">&nbsp;</td>
          <td style="background-color: #592989; padding: 4px; padding-left: 8px; 
    color: #ffffff; font-size: 14px;" width="171" valign="top"><p></p></td>
        <tr>
    </table>
    </body>

1 个答案:

答案 0 :(得分:0)

发送HTML电子邮件的第一条规则使用内联样式。许多客户将删除<head>标记中的任何样式。最安全的做法是在<head><body>标记时不要打扰,因为大部分时间这些标记都会被删除。验证你的HTML。您有一些无效的标记,许多客户将剥离:

<td style="padding-top: 20px;" colspan="4"><table border="0" cellspacing="0" 
    cellpadding="0" align="center">

              <tbody>

应该是:

<td style="padding-top: 20px;" colspan="4"><table border="0" cellspacing="0" 
    cellpadding="0" align="center">
      <table>
              <tbody>
相关问题