Responsive html newsletter - mobile issues when sending to different email clients

86 Views Asked by At

The following code has several issues when sending all Html5 newsletters I coded. I received footer code from the client, but it seems that it doesn't work more. Remaining parts of the newsletters works well. I copied an empty template mail I usually use to code my htmls.


<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>xxxxxx/title>
<style>
    
ul {
  list-style-position: inside;
  padding-left: 0;
}
    a {
    color: inherit !important;
    text-decoration: none !important;
        }
    a[x-apple-data-detectors] {
    color: inherit !important;
    text-decoration: none !important;
    font-size: inherit !important;
    font-family: inherit !important;
    font-weight: inherit !important;
    line-height: inherit !important;
}
    
    .content {
            width: 100%;
            max-width: 600px; !important
        }   
/* GENERAL STYLE RESETS */
    body, #bodyTable { height:100% !important; width:100% !important; margin:0 !important; padding:0 !important; }
    table, td { border-collapse:collapse; }
    .hyphenate {
  /* Careful, this breaks the word wherever it is without a hyphen */
  overflow-wrap: break-word;
  word-wrap: break-word;

  /* Adds a hyphen where the word breaks */
  -webkit-hyphens: auto;
  -ms-hyphens: auto;
  -moz-hyphens: auto;
  hyphens: auto;
}
/*remove blue links for iOS*/
  a[x-apple-data-detectors] {color: inherit !important;text-decoration: none !important;font-size: inherit !important;font-family: inherit !important;font-weight: inherit !important;line-height: inherit !important;}
    @media only screen and (max-width: 480px) {
    /* MUESTRA ENLACE EN MOVIL */   
        .bloque{width: 100%;  display: block!important; height: 40px!important; vertical-align: middle!important}
        .bloque2{width: 100%;  display: block!important; vertical-align: middle!important}
        .bloque2 table{width: 100% !important;}
        table.body {float:left;width:100% !important;padding:0;font-size:13px !important}
        .ancho{width:100% !important}
        .ancho2{width:100% !important;text-align:center !important}
        .ancho3{width:33% !important;margin-bottom:12px !important}
        .ancho3_2{width:25% !important;margin-bottom:12px !important}
        .anchotlfn{width:26% !important;margin-bottom:12px !important}
        .ancho4{width:98% !important}
        .anchon{width:50% !important}
        .separa{ padding:8px 0 !important} 
        .iber{margin:20px 0 0 25% !important}
        .logo{width:40% !important}
        .logo2{width:76% !important}
        td.izqui{text-align:left !important}
        .verde{width:100% !important;font-size:14px !important}
        .gg{width:100% !important;font-size:18px !important}
        .verde2{width:100% !important;font-size:13px !important}
        .oculto{display:none !important}
        .pie{line-height:auto !important;font-size:11px !important}
        .pdtop{padding-top:10px!important}
        .pdbot{padding-bottom:10px!important}
        .pe{width:80% !important;padding-top:3px !important}
        .alto{ height:10px !important;}
        .centrado{text-align:center !important; padding:5px 0 20px 0 !important;}
        .nopad{padding-left: 0px !important}
        .izq{text-align:left !important; float:left !important}
    }   
</style>

</head>
<body bgcolor="#FFFFFF" style="font-family:Arial,Helvetica,sans-serif;font-size:13px;color:#000511">
<!--[if mso]>
<table width="600" border="0" align="center" margin bgcolor="#ffffff" cellpadding="0" cellspacing="0">
  <tr> 
    <td>
       <![endif]-->

<table class="content" width="100%" border="0" align="center" bgcolor="#5c881a" cellpadding="0" cellspacing="0" style="margin: 0 auto">
  <tr>
        <td bgcolor="#FFFFFF"><table width="550" border="0" cellspacing="0" cellpadding="0" class="ancho">
        <tr>
          <td width="24">&nbsp;</td>
          <td width="502"><table width="75%" border="0" cellspacing="0" cellpadding="0" class="ancho" align="left">
              <tr>
                <td>&nbsp;</td>
              </tr>
              <tr>
               <td style="color:#262626;font-size:12px;font-family:Arial,Helvetica,sans-serif">Se non riesci a visualizzare correttamente il&nbsp;messaggio,&nbsp;clicca&nbsp;<a href="#" target="_blank" style="color:#000">qui</a></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
              </tr>
            </table></td>
        </tr>
    </table></td>
    </tr>
    <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="15" class="ancho">
        <tr>
            <td>
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td><img src="img/xxx.jpg" width="100%" border="0" alt="a"></td>
                    </tr>
                    <tr>
                         <td><img src="img/bordo-top.gif" width="100%" border="0" style="display: block;"></td>
                    </tr>
                    <tr>
                        <td bgcolor="#FFFFFF">
                            <table width="100%" border="0" cellspacing="0" cellpadding="45">
                                 <tr>
                                    <td>
                                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                            <tr>
                                                <td align="justify" style="color:#5c881a;font-size:16px;font-family:Arial,Helvetica,sans-serif; line-height: 23px; text-align: justify;">test
</td>
                                            </tr>
                                            </table>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td><img src="img/bordo.gif" width="100%" border="0" style="display: block;"></td>
                    </tr>
                    <tr>
                        <td>
                            <br>
                            <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                      <tbody>
                        <tr bgcolor="#5d881a">
                          <td width="160" height="60" valign="middle" bgcolor="#5d881a" class="bloque pdtop"
                            style="text-align: left; color:#ffffff;font-size:11px;font-family:Arial,Helvetica,sans-serif;">
                            <table border="0" cellspacing="0" cellpadding="0">
                              <tbody>
                                <tr>
                                  <td width="43"><img src="img/tel.gif"></td>
                                  <td valign="middle"
                                    style="text-align: left; color:#ffffff;font-size:11px;font-family:Arial,Helvetica,sans-serif;">
                                    xxx xxx xxx</td>
                                </tr>
                              </tbody>
                            </table>
                          </td>
                          <td width="140" height="60" valign="middle" bgcolor="#5d881a" class="bloque"
                            style="text-align: left; width:140px; color:#ffffff;font-size:11px;font-family:Arial,Helvetica,sans-serif">
                            <table border="0" cellspacing="0" cellpadding="0">
                              <tbody>
                                <tr>
                                  <td width="43"><img src="img/sito.gif"></td>
                                  <td valign="middle"
                                    style="text-align: left; color:#ffffff;font-size:11px;font-family:Arial,Helvetica,sans-serif;">
                                    <a href="" target="_blank"
                                      style="color: #ffffff; text-decoration: none">xxxxxxxxx.it</a>
                                  </td>
                                </tr>
                              </tbody>
                            </table>
                          </td>
                          <td width="255" height="60" valign="middle" bgcolor="#5d881a" class="bloque"
                            style="text-align: left; width:255px; color:#ffffff;font-size:11px;font-family:Arial,Helvetica,sans-serif" >
                            <table border="0" cellspacing="0" cellpadding="0">
                              <tbody>
                                <tr>
                                  <td width="43"><img src="img/mail.gif"></td>
                                  <td valign="middle"
                                    style="text-align: left; color:#ffffff;font-size:11px;font-family:Arial,Helvetica,sans-serif;">
                                    <a style="color: #ffffff; text-decoration: none"
                                      href="mailto:[email protected]">[email protected]</a>
                                  </td>
                                </tr>
                              </tbody>
                            </table>
                          </td>


                          <td height="60" width="110" valign="middle" bgcolor="#5d881a" class="bloque pdbot"
                            style="text-align: left; width:110px; color:#ffffff;font-size:11px;font-family:Arial,Helvetica,sans-serif">
                            <table border="0" cellspacing="0" cellpadding="0">
                              <tbody>
                                <tr>
                                  <td width="46"><a href="https://www.facebook.com/xxxxxxxxx/"
                                      target="_blank"><img src="img/fb.gif" border="0"></a></td>
                                  <td width="46"><a href="https://twitter.com/xxxxxxxxx" target="_blank"><img
                                        src="img/tw.gif" border="0"></a></td>
                                  <td><a href="https://www.instagram.com/xxxxxxxxx/" target="_blank"><img
                                        src="img/ig.gif" border="0"></a></td>
                                </tr>
                              </tbody>
                            </table>
                          </td>
                        </tr>
                      </tbody>
                    </table>
                    </td>
                 </tr>
                 <tr><td><img src="img/line.gif" width="100%"></td></tr>
                <tr><td style="text-align: left; color:#ffffff;font-size:14px;font-family:Arial,Helvetica,sans-serif"><br><br>XXXXX</td></tr>
                </table>
            </td>
        </tr>
    </table></td>
  </tr>  
</table>
 <!--[if (gte mso 9)|(IE)]>
                </td>
            <tr>
        </table>
    <![endif]-->   
</body>
</html>

expected mobile visualization screenshot

actual visualization when the mail is sent

Desktop visualization

0

There are 0 best solutions below