iphone - 100% 宽度表格中的链接会生成 90% 宽度表格

标签 iphone ios email html-email

这真的很奇怪。

下面的代码应该生成 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/

相关文章:

iphone - 除了 MainWindow.xib 之外,是否可以创建没有单独 xib 的通用应用程序?

ios - SpriteKit iPhone/iPad 不同的分辨率,需要相同的物理

api - 遍历 SendGrid 电子邮件模板中的数组

iphone - UIImage 翻转和镜像

iphone - 为什么我的 UILabel 从 20 亿开始倒数?

ios - UICollectionView:页面控件的当前索引路径

javascript - 如何使用 mapview showsUserLocation 而不是专注于 React Native?

ios - 如何打开PDF文件中的url

php - 表单方法 ="post"阻止了我的元刷新发生

android - 发送电子邮件时未找到处理 Intent 的 Activity