垂直对齐不按预期的HTML工作
我正在创建HTML电子邮件签名,由于某种原因,我在垂直垂直对齐图像和一些文本时遇到了问题。我正在通过打开Chrome/Gmail的HTML来查看我的签名,该HTML的作用相同,然后在Outlook中单独检查以检查兼容性问题。垂直对齐都无法使用,但输出的输出略有不同。
我希望解决方案,以垂直对齐图像并在中间垂直将镀铬/gmail和Outlook在中间放置。
我尝试了许多不同的垂直对齐方法,例如在各种元素上使用行高,垂直对齐,高度和显示属性,但它们没有任何区别。
以下是我的代码:
<table role="presentation" width="600" cellpadding="0" cellspacing="0" border="0" style="margin: 20px 0;width: 600px; border-collapse: collapse;">
<tr>
<td cellspacing="0" cellpadding="0" border="0" width="180" height="22" style="font-family: Urbanist, Arial, sans-serif; text-align: left; font-size:16px; font-weight: 400; color: #000; padding: 0 0 0 20px;">
<p style="margin: 0;"><img src="/assets/signature/phone.png" width="22" height="22" style="margin: 0 5px 0 0; width: 22px; height: 22px;" /> XXXXX XXXXXX</p>
</td>
<td cellspacing="0" cellpadding="0" border="0" width="240" height="22" style="font-family: Urbanist, Arial, sans-serif; text-align: center; font-size:16px; font-weight: 400; color: #000;">
<p style="margin: 0;"><span style="text-decoration: none!important; color: #000!important;"><img src="/assets/signature/email.png" width="22" height="22" style="margin: 0 5px 0 0; width: 22px; height: 22px;" /> [email protected]</span></p>
</td>
<td cellspacing="0" cellpadding="0" border="0" width="180" height="22" style="font-family: Urbanist, Arial, sans-serif; text-align: right; font-size:16px; font-weight: 400; color: #000; padding: 0 20px 0 0;">
<p style="margin: 0;"><img src="/assets/signature/web.png" width="22" height="22" style="margin: 0 5px 0 0; width: 22px; height: 22px;" /> www.domain.com</p>
</td>
</tr>
</table>
I'm creating an HTML email signature and for some reason I'm having an issue with aligning an image and some text in the middle vertically. I am looking at my signature by opening the HTML in Chrome/Gmail which both act the same and then separately in Outlook to check for compatibility issues. The vertical alignment doesn't work in either but do output slightly differently.
I'd like a solution to vertical align the image and text together in the middle vertically for both Chrome/Gmail and Outlook.
I've tried lots of different vertical align methods such as using line-height, vertical-align, height and display properties on various elements but they don't make any difference.
Below is my code:
<table role="presentation" width="600" cellpadding="0" cellspacing="0" border="0" style="margin: 20px 0;width: 600px; border-collapse: collapse;">
<tr>
<td cellspacing="0" cellpadding="0" border="0" width="180" height="22" style="font-family: Urbanist, Arial, sans-serif; text-align: left; font-size:16px; font-weight: 400; color: #000; padding: 0 0 0 20px;">
<p style="margin: 0;"><img src="/assets/signature/phone.png" width="22" height="22" style="margin: 0 5px 0 0; width: 22px; height: 22px;" /> XXXXX XXXXXX</p>
</td>
<td cellspacing="0" cellpadding="0" border="0" width="240" height="22" style="font-family: Urbanist, Arial, sans-serif; text-align: center; font-size:16px; font-weight: 400; color: #000;">
<p style="margin: 0;"><span style="text-decoration: none!important; color: #000!important;"><img src="/assets/signature/email.png" width="22" height="22" style="margin: 0 5px 0 0; width: 22px; height: 22px;" /> [email protected]</span></p>
</td>
<td cellspacing="0" cellpadding="0" border="0" width="180" height="22" style="font-family: Urbanist, Arial, sans-serif; text-align: right; font-size:16px; font-weight: 400; color: #000; padding: 0 20px 0 0;">
<p style="margin: 0;"><img src="/assets/signature/web.png" width="22" height="22" style="margin: 0 5px 0 0; width: 22px; height: 22px;" /> www.domain.com</p>
</td>
</tr>
</table>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
那:
?
What about:
?