How do I change the background color of an email? | XM Community
Skip to main content
Solved

How do I change the background color of an email?

  • December 12, 2022
  • 6 replies
  • 480 views

Forum|alt.badge.img+3

I would like the background color of my email invite to be this color: #173963. Is there a way to code that?

Best answer by Tom_1842

MattiasM original code:

<style type="text/css">
body {
background-color: #173963;
}
</style>

ChelseaIC original code, includes a table and changes the background color of the table so will display in gmail:

<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td width="650" valign="top" align="center" bgcolor="#173963">
....
</td>
</tr>
</tbody>
</table>

 

6 replies

MattiasM
Level 5 ●●●●●
Forum|alt.badge.img+63
  • Level 5 ●●●●●
  • December 13, 2022

Hello and good day from a sunny Sweden!

The easiest would be to just add the below HTML in the email:


You need to click the below icon and paste the text in there.
image.png
All the best
-Mattias



Forum|alt.badge.img+3
  • Author
  • Level 1 ●
  • December 13, 2022

Thank you for your help, MattiasM! This did work when drafting the email in Qualtrics, but when I sent a preview email the background color did not appear in my gmail account. So I researched that and found the following code in the link below that worked:






....


https://stackoverflow.com/questions/23650743/body-background-color-not-working-for-email-newsletter


MattiasM
Level 5 ●●●●●
Forum|alt.badge.img+63
  • Level 5 ●●●●●
  • December 14, 2022

Forum|alt.badge.img

@MattiasM Thanks for your help! Would you mind sharing the code again? For some reason the code is not showing up. 


MattiasM
Level 5 ●●●●●
Forum|alt.badge.img+63
  • Level 5 ●●●●●
  • May 17, 2023

@MattiasM Thanks for your help! Would you mind sharing the code again? For some reason the code is not showing up. 

Good morning from a windy Sweden!

I cant remember what I wrote unfortunately, but in general you just need to specify the background in the body, so the setup would be something like: <body bgcolor="hex_number or rgb_number">.

 

All the best

-Mattias


Tom_1842
Level 8 ●●●●●●●●
Forum|alt.badge.img+28
  • Level 8 ●●●●●●●●
  • Answer
  • May 17, 2023

MattiasM original code:

<style type="text/css">
body {
background-color: #173963;
}
</style>

ChelseaIC original code, includes a table and changes the background color of the table so will display in gmail:

<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td width="650" valign="top" align="center" bgcolor="#173963">
....
</td>
</tr>
</tbody>
</table>