【发布时间】:2018-01-10 20:09:48
【问题描述】:
我正在 Mailchimp 中设计邮件,并希望两个按钮并排。因此,我插入了一个代码块并在其中复制了常规按钮元素,然后复制了 td 标签并将其粘贴到第一个 td 标签下方。然后我将“margin-left: 80px”放在第二个按钮的样式中,以便在两者之间留出空间(尝试左右对齐后,但这不起作用)。
我希望两个按钮之间有一个白色(主体背景)空间,但按钮之间的空间与按钮本身的颜色相同。
<table border="0" cellpadding="0" cellspacing="0" class="mcnButtonContentContainer" style="border-collapse: separate !important;border-radius: 3px;background-color: #F59B29;mso-table-lspace: 0pt;mso-table-rspace: 0pt;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%;">
<tbody>
<tr>
<td align="center" valign="middle" class="mcnButtonContent" style="font-family: Arial;font-size: 16px;padding: 15px;mso-line-height-rule: exactly;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%;">
<a class="mcnButton " title="More information" href="https://google.com" target="_blank" style="font-weight: bold;letter-spacing: normal;line-height: 100%;text-align: center;text-decoration: none;color: #FFFFFF;mso-line-height-rule: exactly;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%;display: block;">More information</a>
<td align="center" valign="middle" class="mcnButtonContent" style="font-family: Arial;font-size: 16px;padding: 15px;mso-line-height-rule: exactly;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%;">
<a class="mcnButton " title="More information" href="https://google.com" target="_blank" style="font-weight: bold;letter-spacing: normal;line-height: 100%;text-align: center;margin-left: 80px;text-decoration: none;color: #FFFFFF;mso-line-height-rule: exactly;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%;display: block;">More information</a>
</td>
</tr>
</tbody>
</table>
有人知道为什么边距空间不是背景颜色吗?
【问题讨论】:
-
因为它代表盒子模型之外的空间 - 使用
padding而不是margin。 -
我确实读过,忘了说我也试过了,但仍然显示元素内容颜色,中间的空格是可点击的。