繁体   English   中英

为什么我的元素之间有空白<div>容器?

[英]Why is there white space between the elements in my <div> container?

我对 HTML 很陌生,我已经构建了一个自定义的 HTML 电子邮件签名。 我希望它看起来像这样:

在此处输入图片说明

但是,使用下面的代码,我将彼此相邻的三个字符串在第一个和后续字符串之间以空格结束,如下所示

在此处输入图片说明

将三个字符串组合在一起而不会在元素之间产生间隙的正确方法是什么?

<div class="presentational-container">
  <table role="presentation" cellpadding="0" cellspacing="0" border="0"style="background: none;margin: 0;padding: 10px 10px 0;border-width: 1px 0 0 0;border-style: solid;border-color: #F2F2F2;">
    <tbody>
      <tr class="outer-row" style="padding: 0 12px 0 0;">
        <td class="headshot-cell" style="text-decoration: none;vertical-align: middle;width: 72px;padding: 0 6px 0 0;">
          <a href="http://www.robertcooper.me">
            <img src="https://tetonsports.imagerelay.com/ql/6cde221aa42c4ec8b325b3c0f6235d2e/email-icon-01.png" name="preview-image-url" style="vertical-align: middle;width:72px"/>
          </a>
        </td>
        <td class="description-cell">
          <table role="presentation">
            <tbody>
              <tr>
                <td colspan="2" class="company" style="font-weight: normal;color: #000001;font-size: 14px;font-family: Helvetica, Geneva, sans-serif;">TETON Sports</td>
              </tr>
              <tr>
                <div>
                  <td colspan="2" class="name" style="font-weight: bold;color: #000001;font-size: 14px;font-family: Helvetica, Geneva, sans-serif;">Josh Jorgensen</td>
                  <td colspan="2" class="divider" style="font-weight: bold;color: #FF9E18;font-size: 14px;font-family: Helvetica, Geneva, sans-serif;">//</td>
                  <td colspan="2" class="title" style="font-style: italic;font-weight: normal;color: #54565A;font-size: 14px;font-family: Helvetica, Geneva, sans-serif;">Photographer</td>
                </div>
              </tr>
              <tr>
                <td valign="top" class="website" style="font-style: italic;font-weight: normal;color: #54565A;font-size: 14px;font-family: Helvetica, Geneva, sans-serif;">
                  <a href="josh@tetonsports.com">josh@tetonsports.com</a>
                </td>
              </tr>
            </tbody>
          </table>
        </td>
      </tr>
    </tbody>
  </table>
</div>

这三个文本部分位于单独的表格单元格中,这些表格单元格甚至有colspan="2" 因此,这些与上面和下面也有colspan="2"的行的表格单元格对齐。

我要么将所有三个放在一个单元格中,要么至少从它们中删除colspan="2"并将colspan="3"添加到下方和上方的单元格中,因为所有行都应具有相同数量的单元格以正确排列.

暂无
暂无

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

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