在Outlook中垂直文本对齐不居中[与图片]
问题描述:
我目前正在尝试解决一些HTML电子邮件,在浏览器和通过Gmail呈现罚款的问题,但不幸的是我有问题在Outlook垂直对齐文本(它坚持到底部)。在Outlook中垂直文本对齐不居中[与图片]
此图片显示你什么是错的:
<td align="center" style="font-size:17px;font-weight:bold;line-height:62px;"><a href="url" style="text-decoration:none;color:#000001;">THE WORLD'S BEST BRANDS</a></td>
</tr>
<tr>
<td align="center"><a href="url" style="color:#000001;text-decoration:none;"><img src="url" alt="XXXX" width="593" height="100" class="brandsimage" style="display:block;border:0;" /></a></td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="center" style="font-size:17px;font-weight:bold;line-height:72px;"><a href="url" style="text-decoration:none;color:#000001;">ESSENTIALS</a></td>
</tr>
任何想法如何解决这一问题?
答
添加valign="middle"
和你想有一个高度的<td>
文本垂直居中上:
<tr>
<td align="center" valign="middle" height="100" style="font-size:17px;font-weight:bold;line-height:72px;">
<a href="url" style="text-decoration:none;color:#000001;">ESSENTIALS</a>
</td>
</tr>
HTML电子邮件,经常使用,
valign="top|middle|bottom"
垂直对齐和
align="left|center|right"
的水平对准。
只记得你需要height=""
或width=""
设置在同一个<td>
元素上。
答
对我来说,使其工作,重要的是指定height
和align="center"
为HTML属性和CSS中style
元素复制height
。
\t
<td colspan="3" align="center" height="80px" width="100%"
style="font-family: Arial, Helvetica, sans-serif; font-size: 14px;
color:#666666; height: 80px; background: #cccccc;
padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;">
<strong>for internal use</strong>
</td>
对齐问题也被视为是所有基于字展望(2007年至2016年)。
试过这个,不幸的是没有运气。 – user2619611
@ user2619611摆脱你的线条高度,它会推动你的文本。 – John
设置高度,删除行高和valigning工作,谢谢! – user2619611