2017-09-26 69 views
0

當在Mac OS上顯示使用Outlook 2017創建的HTML簽名時,我正面臨Android上GMail App的奇怪行爲。GMail App中的Outlook HTML簽名:​​元素之間的差距

首先,這裏是我做過什麼:

  1. 我創建了一個簡單的表格佈局的HTML簽名,並在瀏覽器中打開
  2. 我複製從瀏覽器窗口中的內容到簽名板在展望(展望 - >設置 - >簽名)
  3. 我保留了原來的格式粘貼內容

現在,經過簽名基本上看起來很好的瀏覽器,Outlook將Ø Mac和iPhone標準郵件應用程序。在Android的Gmail中,表格行之間有很大差距,我無法找到控制它們的方法。當然,我做了一些研究,最後提出了討論herehere以及許多其他來源的建議。格式問題已在Google Forums中得到解決。 Some People能夠將其分解爲由Outlook添加的特定CSS類MsoNormal,但它們都很古老,並且這些建議似乎對我無效。我已經嘗試了很多東西,最後得到了三個不同的版本,都有相同或相似的結果。

第一版本使用表內的div來構造文本:

<table style='font-family:Arial; cellspacing:0px; cellpadding:0px; padding:0px; margin:0px; border-spacing: 0; line-height:60%;'> 
 
    <tbody> 
 
    <tr> 
 
     <td> 
 
     <img src='http://361nutrition.de/signature/img/dummy.jpg' alt='line' style='width:85px; height:130px; display:block; vertical-align:text-top; line-height:0;' /> 
 
     </td> 
 
     <td style='width:5px'></td> 
 
     <td style='vertical-align:top;'> 
 
     <div style='font-size: 11px; margin:0px; padding:0px;'> 
 
      Peter Pan<br> 
 
      Chief Executive Officer<br> 
 
      <b>The Company</b> 
 
     </div> 
 
     <div style='font-size: 9px; margin:0px; padding:0px;'> 
 
      Reach me at:<br> 
 
      [email protected]<br> 
 
      +00 324 244 20 
 
     </div> 
 
     <div style='font-size: 9px; margin:0px; padding:0px;'> 
 
      ...or visit me at:<br> 
 
      My Office<br> 
 
      Office Street Nr.<br> 
 
      44556 Officetown 
 
     </div> 
 
     </td> 
 
    </tr> 
 

 
    </tbody> 
 
</table>

第二步使用表內的表:

<!DOCTYPE html> 
 
<html> 
 
<head> 
 
<meta charset="UTF-8"> 
 
<style type="text/css"> 
 
     p.MsoNormal { 
 
      margin: 0px !important; 
 
     } 
 
</style> 
 
</head> 
 
<body> 
 
<table class='tbl' style='min-width:300px; font-family:Arial; cellspacing:0px; cellpadding:0px; padding:0px; margin:0px; border-spacing: 0; line-height:60%;'> 
 
    <tbody class='tbl_body'> 
 
    <tr class='tbl_tr' style="display: block; white-space: nowrap;"> 
 
     <td class='tbl_td' style="line-height:0; display: inline-block;"><img src='http://361nutrition.de/signature/img/dummy.jpg' alt='line' style='width:85px; height:130px; display:block; vertical-align:text-top' /></td> 
 
     <!--<td style='width:5px; display: inline-block;'></td>--> 
 
     <td class='tbl_td' style='vertical-align:top; display: inline-block;'> 
 
     <table class='tbl' style='font-family:Arial; cellspacing:0px; cellpadding:0px; padding:0px; margin:0px; border-spacing: 0; line-height:60%;'> 
 
      <tbody class='tbl_body'> 
 
      <tr class='tbl_tr' style='font-size: 11px; margin:0px; padding:0px; display: block; white-space: nowrap;'> 
 
       <td class='tbl_td' style="display: inline-block;">Peter Pan<br>Chief Executive Officer<br><b>The Company</b></td> 
 
      </tr> 
 
      <tr class='tbl_tr' style='font-size: 11px; margin:0px; padding:0px; display: block; white-space: nowrap; '> 
 
       <td class='tbl_td' style="display: inline-block;">Reach me at:<br>[email protected]<br>+00 324 244 20</td> 
 
      </tr> 
 
      <tr class='tbl_tr' style='font-size: 11px; margin:0px; padding:0px; display: block; white-space: nowrap;'> 
 
       <td class='tbl_td' style="display: inline-block;">...or visit me at:<br>My Office<br>Office Street Nr.<br>44556 Officetown</td> 
 
      </tr> 
 
      </tbody> 
 
     </table> 
 
     </td> 
 
    </tr> 
 

 
    </tbody> 
 
</table> 
 
</body> 
 
</html>

最後我用了一個3×2檯布局與圖像跨越3行:

<!DOCTYPE html> 
 
<html> 
 
<head> 
 
    <meta charset="UTF-8"> 
 
    <style type="text/css"> 
 
      p.MsoNormal { 
 
       margin: 0px !important; 
 
      } 
 
    </style> 
 
</head> 
 
<body> 
 
    <table style='font-family:Arial; cellspacing:0; cellpadding:0; border:0; border-collapse: collapse; padding:0px; margin:0px; border-spacing: 0; line-height:60%;'> 
 
    <tbody> 
 
     <tr style='margin:0px; padding:0px;'> 
 
     <td rowspan="3" style='line-height:0'> 
 
      <img src='http://361nutrition.de/signature/img/dummy.jpg' alt='line' style='width:85px; height:130px; display:block; vertical-align:text-top' /> 
 
     </td> 
 
     <td style='font-size: 11px; margin:0px; padding:0px;'>Peter Pan<br>Chief Executive Officer<br><b>The Company</b></td> 
 
     </tr> 
 
     <tr style='margin:0px; padding:0px;'> 
 
     <td style='font-size: 11px; margin:0px; padding:0px;'>Reach me at:<br>[email protected]<br>+00 324 244 20</td> 
 
     </tr> 
 
     <tr style='margin:0px; padding:0px;'> 
 
     <td style='font-size: 11px; margin:0px; padding:0px;'>...or visit me at:<br>My Office<br>Office Street Nr.<br>44556 Officetown</td> 
 
     </tr> 
 
    </tbody> 
 
    </table> 
 
</body>

在Gmail中的表的方法的結果看起來有點像這樣:

Table Layout

而div方法有點像這樣:

Div Layout

正如您所看到的,文本框之間有很大差距,儘管沒有餘量,填充,單元格間距或任何其他值。

我已經擺弄CSS了很多,並沒有拿出任何解決方案。

我希望有人能幫忙。

問候, 馬庫斯

回答

0

首先,你嘗試在你的腦袋部分使用<meta name="viewport" content="width=device-width" />

然後,你也儘量減少你的<td>line-height,或包裹你所有的信息在一個<td>標記,並把一些<br>斷裂呢?

希望它的幫助。

Chaaampy。