100% 宽度的表格在 Gmail Android 中不起作用 [英] 100% width tables don't work in Gmail Android
问题描述
我正在尝试构建一个响应式电子邮件——它实际上在所有方面都非常有效,除了一些不能在 Android 版 Gmail 中协作的小部分.
I'm trying to build a responsive email – it's actually working pretty great across the board, except for some small pieces that aren't co-operating in Gmail for Android.
我在电子邮件顶部有这些非常简单的黑色条纹作为装饰元素:
I have these seriously simple black stripes that sit at the top of the email as a decorative element:
<table width="100%" cellpadding="0" cellspacing="0" align="center" valign="top">
<tr><td width="100%" height="11" bgcolor="#000000"></td></tr>
<tr><td width="100%" height="2" bgcolor="#FFFFFF"></td></tr>
<tr><td width="100%" height="1" bgcolor="#000000"></td></tr>
<tr><td width="100%" height="30" bgcolor="#FFFFFF"></td></tr>
</table>
然而,它们只是显示为类似于 Gmail Android 应用上的超薄感叹号的一小条黑白条纹.
Yet they don't display as anything more than a tiny strip of black and white that resembles an ultra-thin exclamation point on the Gmail Android app.
同样,有一个页脚没有跨越电子邮件的整个宽度:
Likewise, there is a footer that isn't spanning the full width of the email:
<table width="100%" border="0" cellpadding="0" cellspacing="0" align="center" bgcolor="#000000">
<tr>
<td>
<table width="650" border="0" cellpadding="0" cellspacing="0" align="center" bgcolor="#000000">
<tr>
<td align="right" class="footer">
<img src="images/footer.png" />
</td>
</tr>
</table>
</td>
</tr>
</table>
关于如何使这些跨越电子邮件的整个宽度的任何建议?
Any suggestions on how to make these span the full width of the email?
推荐答案
如果您还没有找到解决方案,请尝试
If you haven't found a solution try
style="width:100%!important" 喜欢
style="width:100%!important" like
<table width="100%" border="0" cellpadding="0" cellspacing="0" align="center" bgcolor="#000000" style="width:100%!important">
Gmail 喜欢去除大部分 CSS,但如果您添加标签 !important 将在大部分时间保留它们.
Gmail likes to strip most of the CSS, but if you add a label !important will keep them most of the time.
这篇关于100% 宽度的表格在 Gmail Android 中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!