The <body> tag is removed in Yahoo and AOL, so any background color applied to it will not appear in those email clients. And placing a color on a wrapping <div> after the body would work everywhere except in Outlook clients, as they don't support <div> tags in emails. For the widest range of email customer support, wrap your entire email in a 100% width <table> tag and place your background color inside. And use <td> table cells for sections of your email to have more flexibility in coloring specific blocks of content. 2. Add color with CSS property and HEX color codes or RGB values Background colors can be coded in several ways: Using the bgcolor HTML attribute Using the CSS background-color property Using CSS shorthand property background Using the 6-digit hexadecimal color code Using the 3-digit hexadecimal color code Working with RGB color values As for how to put the background color on your table or table cell, you need to use a CSS property.
When testing the two CSS property methods (background-color and background), we found that they both have the same consistent results as long as you only add color (no images). According to caniemail.com, using the background property for anything other than adding a color can cause your color to not display. The bgcolor HTML attribute did not work E-Commerce Photo Editing Service well in Outlook, with inconsistent support for 3-digit HEX codes. And using RGB and RGBA values resulted in incorrect color or complete color removal. Here's our background color test using Outlook's different methods so you can see for yourself: Litmus test of background color rendering in HTML emails in Outlook See this test in Litmus → In other email clients, the 3-digit .
HEX code was displayed fine, but RGB and RGBA values resulted in incorrect colors when applied to the bgcolor HTML attribute. Litmus test of background color rendering in HTML emails in Apple Mail See this test in Litmus → After all our tests, we came to one conclusion: respect the CSS properties and use 3 or 6 digit HEX codes or RGB values. These worked on all email clients. Introducing opacity with the alpha for the RGBA value was not supported in Outlook, Web.de or GMX.de, but had decent support otherwise. So your final code should look like this to color the entire background of a table: