【问题标题】:Formatting HTML for Gmail signature为 Gmail 签名设置 HTML 格式
【发布时间】:2018-04-10 20:32:00
【问题描述】:

我有一个可以正常工作的现有 Gmail 签名。它在一年多前被保存并实施。我尝试复制/粘贴相同的签名,但即使它坏了。这几乎就像 Gmail 改变了它们允许 HTML 签名的方式。

我想问是否有人对我有任何建议。我尝试将所有类更改为内联样式,但仍然没有运气。需要明确的是,它会在徽标图像之后立即换行,但仅在发送后才换行。

当我在草稿中作曲时,签名很好。只有在发送后才会在徽标后换行。

有什么建议吗?任何人都可以提供任何指导来格式化此 HTML 以用作 Gmail 签名吗?

这是我的代码:

<!DOCTYPE html>
<html>
  <head>
    <style type="text/css">
      img { margin: 0; padding: 0; outline: none; border: none; }

      h1, h2, div, a { font-family: Tahoma, Sans-Serif; }

      h1, h2 { margin: 0 0 0 0; font-weight: 500; }

      a, a:hover { color: #000; text-decoration: none; }

      h1 { font-size: 16px; }
      h2 { font-size: 14px; }


      .column { display: inline-block; }
      .column:first-of-type {
        margin-right: 5px;
        padding-right: 5px;
        border-right: 1px solid #343a40;
      }

      img.logo {
        width: 55px;
        height: 55px;
      }




      .contact { margin: 0 0 0 0; font-weight: 500; }
      .contact > a:first-of-type {
        display: inline-block;
        font-size: 14px;
        color: #777;
        margin-right: 25px;
        padding-top: 3px;
      }

      .social-icons { float: right; }
      .social-icons img {
        width: 18px;
        height: 18px;

        margin: 4px 0 0 5px;

        line-height: 0;
      }


    </style>
  </head>
  <body>

    <section class="email-signature-container">

      <div class="column">
        <img class="logo" src="https://i.imgur.com/x8NDcYM.png" alt="SISYN Networking" />
      </div>
      <div class="column">
        <h1>Dan Lindsey</h1>
        <h2>Full Stack Engineer, <a target="_blank" href="http://luxdig.com">LuxDigital</a></h2>
        <div class="contact">
          <a href="tel:336-355-5575">336-355-5575</a>
          <div class="social-icons">
            <a target="_blank" href="https://linkedin.com/in/mdlindsey"><img src="https://i.imgur.com/tkL1tNk.png" alt="LinkedIn" /></a>
            <a target="_blank" href="https://stackoverflow.com/users/9468754/lux"><img src="https://i.imgur.com/0luxbot.png" alt="StackOverflow" /></a>
            <a target="_blank" href="https://github.com/sisyn"><img src="https://i.imgur.com/pBv6GHr.png" alt="GitHub" /></a>
            <!--

            <a target="_blank" href="Skype:336-355-5575"><img src="https://i.imgur.com/83Jil5D.png" alt="Skype" /></a>
            <a target="_blank" href="https://fb.com/dan.sisyn"><img src="https://i.imgur.com/LU362Re.png" alt="Facebook" /></a>
            <a target="_blank" href="#"><img src="twitter.png" alt="Twitter" class="social-icon" /></a>
            <a href="#"><img src="youtube.png" alt="YouTube" class="social-icon" /></a>
            <a href="#"><img src="google.png" alt="Google+" class="social-icon" /></a>

          -->
          </div>
        </div>
      </div>



    </section>



  </body>
</html>

【问题讨论】:

    标签: html css gmail html-email


    【解决方案1】:

    我看到您缺少显示块、图像边框并且您正在使用 div。我已将显示块添加到图像和边框。我还在社交媒体图标周围放置了一张桌子。

    <!DOCTYPE html>
    <html>
      <head>
        <style type="text/css">
          img { margin: 0; padding: 0; outline: none; border: none; }
    
          h1, h2, div, a { font-family: Tahoma, Sans-Serif; }
    
          h1, h2 { margin: 0 0 0 0; font-weight: 500; }
    
          a, a:hover { color: #000; text-decoration: none; }
    
          h1 { font-size: 16px; }
          h2 { font-size: 14px; }
    
    
          .column { display: inline-block; }
          .column:first-of-type {
            margin-right: 5px;
            padding-right: 5px;
            border-right: 1px solid #343a40;
          }
    
          img.logo {
            width: 55px;
            height: 55px;
          }
    
    
    
    
          .contact { margin: 0 0 0 0; font-weight: 500; }
          .contact > a:first-of-type {
            display: inline-block;
            font-size: 14px;
            color: #777;
            margin-right: 25px;
            padding-top: 3px;
          }
    
          .social-icons { float: right; }
          .social-icons img {
            width: 18px;
            height: 18px;
    
            margin: 4px 0 0 5px;
    
            line-height: 0;
          }
    
    
        </style>
      </head>
      <body>
    
        <section class="email-signature-container">
    
          <div class="column">
            <img class="logo" src="https://i.imgur.com/x8NDcYM.png" alt="SISYN Networking" style="display: block;border:0px;" />
          </div>
          <div class="column">
            <h1>Dan Lindsey</h1>
            <h2>Full Stack Engineer, <a target="_blank" href="http://luxdig.com">LuxDigital</a></h2>
            <div class="contact">
              <a href="tel:336-355-5575">336-355-5575</a>
              <div class="social-icons">
    			  <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tbody>
        <tr>
          <td><a target="_blank" href="https://linkedin.com/in/mdlindsey"><img src="https://i.imgur.com/tkL1tNk.png" alt="LinkedIn" style="display: block;border:0px;" /></a></td>
          <td><a target="_blank" href="https://stackoverflow.com/users/9468754/lux"><img src="https://i.imgur.com/0luxbot.png" alt="StackOverflow" style="display: block;border:0px;" /></a></td>
          <td><a target="_blank" href="https://github.com/sisyn"><img src="https://i.imgur.com/pBv6GHr.png" alt="GitHub" style="display: block;border:0px;" /></a></td>
        </tr>
      </tbody>
    </table>
    
                
                
                
                <!--
    
                <a target="_blank" href="Skype:336-355-5575"><img src="https://i.imgur.com/83Jil5D.png" alt="Skype" /></a>
                <a target="_blank" href="https://fb.com/dan.sisyn"><img src="https://i.imgur.com/LU362Re.png" alt="Facebook" /></a>
                <a target="_blank" href="#"><img src="twitter.png" alt="Twitter" class="social-icon" /></a>
                <a href="#"><img src="youtube.png" alt="YouTube" class="social-icon" /></a>
                <a href="#"><img src="google.png" alt="Google+" class="social-icon" /></a>
    
              -->
              </div>
            </div>
          </div>
    
    
    
        </section>
    
    
    
      </body>
    </html>

    让我知道这是否适合你(我认为它会)

    【讨论】:

    • 这仍然有同样的换行问题。 :( 另外,由于某种原因,它在粘贴到 Gmail 时会显示奇怪的表格边框。有没有办法防止这种情况发生?
    • 你能给这个评论加个截图吗,让我看看它显示的内容。
    • Here is a series of screenshots 首先是它在HTMLMail.pro website tool中的出现方式。第二个是它在我的已发送/收件箱文件夹中的显示方式。第三个是扩展第二个屏幕截图中的 3 个点后的样子。感谢您花时间帮助我,我真的很感激。
    • 第一张图片:第一张截图显示了用于将社交媒体图标放在一起的表格。第二张图片:您似乎打开了对话视图?如果是,请关闭它以查看它的外观。就像我们不能对 Gmail 转换视图做任何事情一样,这个(已发送/收件箱文件夹)可能也是如此。第三张图片:检查#2 的建议解决方案
    • 另外,我认为我不会注册 htmlmail.pro,因为他们的 Gmail 连接器未经 Google 验证。
    猜你喜欢
    • 2016-11-10
    • 2012-02-21
    • 1970-01-01
    • 1970-01-01
    • 2017-03-03
    • 1970-01-01
    • 2017-03-15
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多