html - 电子邮件签名 - 对齐元素
问题描述
我第一次尝试编写电子邮件签名。我在我的一个tr
标签中垂直居中元素时遇到问题。我不能使用flex
,我不知道该怎么做。如您所见:idea:图标不在垂直中心
<table cellpadding="0" cellspacing="0" style="width: 100%; max-width: 600px;margin-left:auto;margin-right:auto; padding: 20px; border: none; box-shadow:
none;font-family:'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
color: #1D1D1B; display: table;">
<tr>
<td colspan="3" width="100%" style="background-color:#CB444E; padding: 20px 34px; display: table-cell; vertical-align: middle;">
<img src="https://www.flaticon.com/svg/vstatic/svg/3176/3176276.svg?token=exp=1612785759~hmac=066a03b72474de481ab5b4bca68a9a5d" alt="" style="width: 20px;">
<span style="color: #fff; font-size:10px ;">Lorem ipsum dolor sit amet</span>
<button style="background-color: #fff; border: none; border-radius: 45px; width: 162px;height: 32px;"><a
href=""
style="text-decoration: none; color: #CB444E; font-weight: bold; font-size: 10px;">Lorem ipsum ipsu</a></button>
</td>
</tr>
</table>
解决方案
对于居中元素,请尝试align-items
或margin-left
要向右移动,请尝试使用float
或margin-left
推荐阅读
- java - 图书馆找不到自己的“子图书馆”
- python - Pandas 仅替换包含数字的列的数字
- node.js - Node.js 的 GraphicsMagick 可以处理不固定数量的图像以输出 GIF 序列吗?
- android - 查看绑定问题
布局 - mysql - 如何在开始时对特定值进行排序?
- logging - 使用 Graph API 从 Office365 获取日志
- django - Docker 和 POSTGRESQL
- node.js - Node.js、Angular、express-session:由于 cookie 策略(sameSite cookie),Chrome 80 不保存会话
- node.js - 在 npm-cache 目录中,除了 _cacache 之外的文件夹是干什么用的?
- algorithm - 冒泡排序需要多少遍?