这真的很奇怪。
下面的代码应该生成 100% 宽度的电子邮件,顶部带有石灰色。但由于 TD 包含链接,整个表格现在占 90%(左右)——但仅限于 iPhone 电子邮件。删除链接,电子邮件是正确的...发生了什么事?
https://s3.amazonaws.com/resultcaptures/C1C356D4-EAC0-4A50-B278-04155E256E51.png
我将我的电子邮件简化为:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Email</title>
</head>
<body bgcolor="brown" style="margin:0;padding:0; ">
<table cellpadding="0" cellspacing="0" width="100%" bgcolor="black">
<tr>
<td bgcolor="Lime">
<div><a href="#" alt="">This</a> is a link</div>
</td>
</tr>
</table>
</body>
</html>
没有什么问题......对吧? ...还是我瞎了?
最佳答案
此 MacRumors 线程提供了该问题的解决方案:http://forums.macrumors.com/showthread.php?t=1158457
Try to put align="center" and style="text-align:center" onto the first table and then put style="text-align:left" onto the second one if necessary.
如果您将内容放在居中对齐的父表格中,奇怪的是,这似乎消除了 iPhone 邮件阅读器上的右边距。
关于iphone - 100% 宽度表格中的链接会生成 90% 宽度表格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10398227/