Gmail HTML email background

15,488

Solution 1

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;

Solution 2

You answered your own question.

GMAIL doesn't use the "background-position

article

Share:
15,488
jwktje
Author by

jwktje

Updated on June 04, 2022

Comments

  • jwktje
    jwktje almost 2 years

    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?

    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">