Gmail HTML电子邮件背景 [英] Gmail HTML email background
问题描述
我正在处理HTML电子邮件.我得到的问题是GMAIL不使用我给它的背景位置".我有一张桌子的宽度为100%,其背景必须居中.大多数客户都能完美地做到这一点,但Gmail却不能.有解决方法吗?
I'm working on an HTML email. The problem I get is that GMAIL doesn't use the "background-position" i give it. I have a table with 100% width that has a background that has to be centered. Most clients do this perfectly but Gmail doesn't. Is there a workaround for this?
内联CSS是这样的:(我将所有背景属性分割开了,因为否则大多数客户端不会以正确的方式显示它)
The inline CSS is like this: (i've split all the background properties up because otherwise most clients don't display it the right way)
<table style="background-repeat: no-repeat; background-position: center top;" border="0" width="100%" align="center" bgcolor="#1E1411" background="assets/mainback2.jpg">
推荐答案
有可能,您只需将所有背景样式都放在一行中,就像这样:
It IS possible, you simply have to put all the background style in one line, like so:
background:#1E1411 url(assets/mainback2.jpg) no-repeat center top;
但是,由于某些电子邮件客户端无法处理背景图片,因此您必须将颜色分开.
But because some email clients can't handle background images you have to separate the colors.
background:url(assets/mainback2.jpg) no-repeat center top;
background-color:#1E1411;
这篇关于Gmail HTML电子邮件背景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!