gmail html email background color

前端 未结 4 1627
走了就别回头了
走了就别回头了 2020-12-30 01:56

IS there any way to put color as background in HTML email for gmail?

I used this for making body background grey but it doesnt work



        
相关标签:
4条回答
  • 2020-12-30 02:31

    in most cases you will have a centered email ... so do this an easy align="center" didnt work for me so i make a width="1680px"

    <table>
    <tr>
        <td width="1680px"  align="center" valign="middle" bgcolor="#e4ebdd">
    
            <table width='600' align='center' bgcolor='#ffffff'>
            <!-- .... -->
    
        </td>
    </tr>
    

    0 讨论(0)
  • 2020-12-30 02:35

    I just had to do the same thing. If you put your email body into a table, you can set the table's bgcolor and that will work.

    I had <body bgcolor='lightcyan'>, then I changed it to <body> <table bgcolor='lightcyan'> and put my content into that table.

    0 讨论(0)
  • 2020-12-30 02:41

    Wrap your email in a single celled table with 100% width and height and set the background colour for that cell.

    <table width="100%" height="100%">
        <tr>
            <td width="100%" height="100%" bgcolor="#e2e3e7">
    
                <!-- "Content" table goes here -->
                <table width="600" align="center" bgcolor="#ffffff">
    
                </table>
    
            </td>
        </tr>
    </table>
    
    0 讨论(0)
  • 2020-12-30 02:56

    Gmail (and other mailers) remove all css that is not inlined. So the hack of the tables works only because you define the color inline. You don't need a table, instead use

    <body style="background-color:#242a30;">
    
    0 讨论(0)
提交回复
热议问题