Search code examples
htmlcssgmailhtml-tablehtml-email

Unwanted lines in HTML email in gmail app


In am creating a bunch of emails for an email-flow. For some reason I can't find, when I test the email in the GMAIL APP there is some unwanted grey lines at 1px height.

enter image description here

I just can't find out why they are there. It seems that it's only in the GMAIL APP - I am testing using litmus.com

The HTML for the email:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional //EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    <!--[if !mso]><!-->
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <!--<![endif]-->
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Vores 5 bedste råd inden boligkøbet</title>
    <meta http-equiv="Content-Type" content="text/html charset=UTF-8" />
    <!--[if (gte mso 9)|(IE)]>
    <style type="text/css">
        table {border-collapse: collapse;}
    </style>
    <![endif]-->
    <!--[if mso]>
            <style> body,table tr,table td,a, span,table.MsoNormalTable {  font-family:Arial, Helvetica, sans-serif !important;  }
    </style>
        <!--<![endif]-->
    <style type="text/css">
        @media screen and (max-width: 525px) {
            h1 {
                font-size: 30px !important;
            }
        }
    </style>
</head>
<body bgcolor="#3d6e9c" style="padding: 0; margin: 0;">

    <div style="background-color:#3d6e9c;">
        <!--[if gte mso 9]>
        <v:background xmlns:v="urn:schemas-microsoft-com:vml" fill="t">
          <v:fill type="tile" src="http://naborapporten.its-umbraco.dk/emails/bg.jpg" color="#3d6e9c"/>
        </v:background>r
        <![endif]-->
        <table height="100%" width="100%" cellpadding="0" cellspacing="0" border="1">
            <tr>
                <td valign="top" align="left" background="http://naborapporten.its-umbraco.dk/emails/bg.jpg">

                    <center>
                        <!--[if (gte mso 9)|(IE)]><table width="650" align="center" cellpadding="0" cellspacing="0" border="0"><tr><td><![endif]-->
                        <table cellspacing="0" cellpadding="0" border="0" style="border: none; border-collapse: collapse; width: 100%;">
                            <tr>
                                <td background="http://naborapporten.its-umbraco.dk/emails/bg.jpg" align="center" style="font-family: Arial; padding-top: 100px; padding-bottom: 100px; padding-left: 15px; padding-right: 15px;">
                                    <table border="0" align="center" cellspacing="0" cellpadding="0" style="width: 100%; max-width: 650px; border-collapse: collapse; border: none; ">
                                        <tr>
                                            <td height="43" valign="bottom"><img src="http://naborapporten.its-umbraco.dk/emails/top.png" valign="bottom" style="font-family: Arial; max-width: 650px; width: 100%; height: auto; vertical-align: bottom; border-collapse: collapse;"></td>
                                        </tr>
                                        <tr>
                                            <td align="center" bgcolor="#ffffff" style="font-family: Arial; padding-left: 15px; padding-right: 15px; padding-top: 45px; padding-bottom: 45px; border-collapse: collapse;">
                                                <h1 style="color: #707986; font-size: 45px; margin-bottom: 0; mso-line-height-rule: exactly; line-height: 90%;"><b><b>Din Naborapport™</b></b></h1>

                                                <!--[if (gte mso 9)|(IE)]><table width="470" align="center" cellpadding="0" cellspacing="0" border="0"><tr><td><![endif]-->

                                                <table cellpadding="0" cellspacing="0" border="0" style="border-collapse: collapse; max-width: 470px; width: 100%;">
                                                    <tr>
                                                        <td align="center" style="color: #707986; font-size: 18px; padding-top: 45px; border-collapse: collapse;"><b>@Model.FullAddress</b></td>
                                                    </tr>
                                                </table>

                                                <!--[if (gte mso 9)|(IE)]></td></tr></table><![endif]-->


                                            </td>
                                        </tr>

                                        <tr>

                                            <td align="center" bgcolor="#ffffff">

                                                <!--[if (gte mso 9)|(IE)]><table width="470" align="center" cellpadding="0" cellspacing="0" border="0"><tr><td><![endif]-->

                                                <table border="0" cellspacing="0" cellpadding="0" align="center" style="max-width: 470px; width: 100%; border-collapse: collapse;">
                                                    <tr>
                                                        <td align="center" bgcolor="#ffffff" valign="middle" style="padding-top: 45px; padding-bottom: 45px;  padding-left: 15px; padding-right: 15px;"><a href="@Model.NeighbourReportUrl"><img src="http://naborapporten.its-umbraco.dk/gfx/email/knap_til_naborapport.png" border="0" style="border: none; max-width: 100%; height: auto;"></a></td>
                                                    </tr>

                                                    <tr>
                                                        <td align="center" bgcolor="#ffffff">

                                                            <table cellpadding="0" cellspacing="0" border="0">
                                                                <tr>
                                                                    <td align="center" bgcolor="#ffffff" style="font-family: Arial; max-width: 470px; width: 100%;  padding-left: 15px; padding-right: 15px;">
                                                                        <h2 style="color: #1fbba7; font-size: 30px; font-weight: bold;">Naborapporten giver dig et unikt indblik i nabolaget</h2>

                                                                        <table>
                                                                            <tr>
                                                                                <td align="center" valign="middle" style="font-size: 18px; color: #5d6573; ">
                                                                                    <p><b>Hvilke typer er dine naboer?</b></p>

                                                                                    <p><b>Hvad er afstanden til skole, indkøb og transport?</b></p>

                                                                                    <p><b>Hvad beskæftiger dine naboer sig med til dagligt?</b></p>

                                                                                    <b>Hvad er prisudviklingen på boliger i området?</b>
                                                                                </td>
                                                                            </tr>
                                                                        </table>

                                                                    </td>
                                                                </tr>
                                                            </table>
                                                        </td>
                                                    </tr>

                                                </table>

                                                <!--[if (gte mso 9)|(IE)]></td></tr></table><![endif]-->


                                            </td>
                                        </tr>
                                        <tr>
                                            <td valign="middle" align="center" bgcolor="#ffffff" style="font-family: Arial; padding-top: 45px; padding-left: 15px; padding-right: 15px; border-collapse: collapse;">
                                                <span style="color: #1fbba7; font-size: 18px; font-weight: bold;">Få gode råd til huskøbet på vores boligunivers</span>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="center" bgcolor="#ffffff" style="padding-top: 45px; padding-bottom: 45px; padding-left: 15px; padding-right: 15px; border-collapse: collapse;">
                                                <a href="#"><img src="http://naborapporten.its-umbraco.dk/emails/kvittering/knap_book.png" style="border: none; max-width: 100%; height: auto;" /></a>
                                            </td>
                                        </tr>

                                        <tr>
                                            <td bgcolor="#eeeeee" align="center" valign="middle" style="padding-top: 45px; border-collapse: collapse;">
                                                <img src="http://naborapporten.its-umbraco.dk/emails/logo.png">
                                            </td>
                                        </tr>
                                        <tr>
                                            <td valign="top" style="border-collapse: collapse;"><img src="http://naborapporten.its-umbraco.dk/emails/bund.png" valign="top" alt="" style="max-width: 100%; height: auto;"></td>
                                        </tr>
                                        <tr>
                                            <td height="92" align="center" valign="middle" style="border-collapse: collapse;"><a href="#" style="color: #ffffff !important; text-decoration: none; color: #ffffff; font-family: Arial; font-size: 18px;"><b>Afmeld</b></a></td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                        </table>
                        <!--[if (gte mso 9)|(IE)]></td></tr></table><![endif]-->
                    </center>

                </td>
            </tr>
        </table>
    </div>

</body>
</html>

Solution

  • It looks to me like your background color is bleeding through. This is a common problem on iOS devices as well as some other apps. Is there a reason why you're setting a background color on the body and first div tag?