简体   繁体   English

gmail对HTML电子邮件签名的处理方式不同

[英]HTML e-mail signature is disaplayed differently by gmail

I am using Thunderbird as my primary work mail client. 我使用Thunderbird作为我的主要工作邮件客户端。 I have just created a new HTML signature, which shows correctly in the Thunderbird, in Opera and in an online HTML Viewer but not on GMail. 我刚刚创建了一个新的HTML签名,它在Thunderbird,Opera和在线HTML查看器中正确显示,但在GMail上没有。 I would be very grateful if anyone could point me in the direction of what the problem is about. 如果有人能指出我的问题是什么,我将非常感激。 I have attached the .html signature file. 我附上了.html签名文件。

EDIT: I realized that I didn't specify the problem: when I inspect the elements in Opera on the GMail web inbox I see that the whole text is formated to Arial, 12.8 px while losing the different color on the first line (class = .name). 编辑:我意识到我没有指定问题:当我在GMail web收件箱中检查Opera中的元素时,我看到整个文本格式化为Arial,12.8 px,同时在第一行丢失了不同的颜色(class = 。名称)。

My CSS is very rusty so I suspect the error is on my side... 我的CSS非常生疏,所以我怀疑错误在我身边......

EDIT 2: code below as corrected by Tim Gerhard (thanks a lot!) 编辑2:以下代码由Tim Gerhard更正(非常感谢!)

<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="content-type">
    <style type="text/css">
      .normal{font-family:"Arial"; font-size:9pt; line-height:1.25; color:#606060; font-weight:400}
      .name{font-size:10.5pt; color:rgb(119,187,65); font-weight:700;}
      .link{color:rgb(17,85,204)}
    </style>
  </head>
  <body>
    <div class="normal">
      <span class="name">Rostislav Janda</span></br>
      Obchodní zástupce</br></br>
      <a style="link"; href="tel:+420%20721%20604%20707" value="+420721604707" target="_blank">+420 721 604 707</br>
      <a style="link"; href="http://www.iqbudovy.cz"> www.iqbudovy.cz</a>
      </br></br>
      IQ Budovy s.r.o.</br>
      <a style="link"; href="[map link]">Mečířova 5, 612 00 Brno</a></br></br>
      <img alt="IQ_Logo" src="[image address]">
      <br><br><br>
    </div>
  </body>
</html>

Edit: 编辑:

You can use inline stylings to style your E-Mail as classnames aren't fully supported (as far as I', concerned). 您可以使用内联样式来设置电子邮件的样式,因为不完全支持类名(就我而言)。 Use style="color:red" instead of classes. 使用style="color:red"而不是类。 Inline should work with every Mail program. 内联应该适用于每个Mail程序。

Your html was full of errors which probably caused the issue. 你的html充满了可能导致问题的错误。

I took the time to fix it and this is the (now correct) markup: 我花时间修复它,这是(现在正确的)标记:

 <html> <head> <meta content="text/html; charset=UTF-8" http-equiv="content-type"> <style type="text/css"> .normal { font-family: "Arial"; font-size: 9pt; line-height: 1.25; color: #606060; font-weight: 400; } .name { font-size: 10.5pt; color: rgb(119, 187, 65); font-weight: 700; } .link { color: rgb(17, 85, 204); } </style> </head> <body> <div class="normal"> <span class="name">Rostislav Janda</span><br/> Obchodní zástupce<br/> <br/> <a class="link" href="tel:+420%20721%20604%20707" value="+420721604707" target="_blank">+420 721 604 707</a><br/> <a class="link" href="http://www.iqbudovy.cz"> www.iqbudovy.cz</a> <br/> <br/> IQ Budovy sro<br/> <a class="link" href="[map link]">Mečířova 5, 612 00 Brno</a><br/> <br/> <img alt="IQ_Logo" src="[image address]"/> <br><br><br> </div> </body> </html> 

What was wrong?: 什么问题?:

  • You use the <br> tag wrong. 您使用<br>标签错误。 It's <br/> and not </br> 它是<br/>而不是</br>
  • One of your image tags was not closed properly 您的某个图片代码未正确关闭
  • One of your hyperlinks ( <a> ) was not closed 您的一个超链接( <a> )未关闭
  • You use style="" instead of class="" 你使用style =“”而不是class =“”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM