【问题标题】:Gmail email table padding being removed in actual email在实际电子邮件中删除 Gmail 电子邮件表格填充
【发布时间】:2017-07-12 21:48:23
【问题描述】:

我在 gmail 中的表格上遇到了填充问题。非常感激任何的帮助。请记住,这是一封 gmail 电子邮件,因此不幸的是,所有 css 都必须是内联的。谢谢!

在带有适当填充的组合消息中看起来像这样:

然后它似乎删除了实际电子邮件中表格上的填充:

这是在 td 元素中有填充的代码:

<td background="http://timshoemake.io/wp-content/uploads/email-template/prowler3.png" style="line-height:10px; border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt; border:0;padding-top:40px !important;padding-right:30px !important;padding-bottom:20px !important;padding-left:30px !important; background-image:url('http://timshoemake.io/wp-content/uploads/email-template/prowler3.png'); background-size: cover; -webkit-background-size: cover; -moz-background-size: cover -o-background-size: cover; background-position: center; background-repeat: no-repeat;">

代码:

 <table style="max-width: 600px;" align="center" cellpadding="0" cellspacing="0" border="0" >
            <tr>
                <td background="http://timshoemake.io/wp-content/uploads/email-template/prowler3.png" style="line-height:10px; border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt; border:0;padding-top:40px !important;padding-right:30px !important;padding-bottom:20px !important;padding-left:30px !important; background-image:url('http://timshoemake.io/wp-content/uploads/email-template/prowler3.png'); background-size: cover; -webkit-background-size: cover; -moz-background-size: cover -o-background-size: cover; background-position: center; background-repeat: no-repeat;">

                <table width="70" align="left" border="0" cellpadding="0" cellspacing="0" >
                    <tr>
                        <td height="70" style="padding: 0 20px 20px 0;">
                            <img src="http://timshoemake.io/wp-content/uploads/email-template/shoemaker_repair_blue@2x-2.png"  style="height: auto; "width="70" height="70" border="0" alt="" / >
                        </td>
                        <td>
                            <!--[if (gte mso 9)|(IE)]>
                            <table width="425" align="left" cellpadding="0" cellspacing="0" border="0">
                                <tr>
                                    <td>
                                    <![endif]-->
                                        <table align="left" border="0" cellpadding="0" cellspacing="0" style="width: 425px!important; width: 100%; max-width: 425px;">
                                            <tr>
                                                <td height="70">
                                                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                    <tr>
                                                        <td style="font-size: 15px; color: #ffffff; font-family: sans-serif; letter-spacing: 10px; padding: 0 0 0 3px;">
                                                            CREATING
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td style="font-size: 33px; line-height: 38px; font-weight: bold; color: #ffffff; padding: 5px 0 0 0;">
                                                            Beautiful Fitness Web Design
                                                        </td>
                                                    </tr>
                                                </table>
                                                </td>
                                            </tr>
                                        </table>
                                    <!--[if (gte mso 9)|(IE)]>
                                    </td>
                                </tr>
                            </table>
                            <![endif]-->
                        </td>
                    </tr>
                </table>
                </td>
            </tr>
              </table>

【问题讨论】:

    标签: html email gmail


    【解决方案1】:

    我只能说,真是一场噩梦。我必须创建 td 空间块并完全取出填充。这是完成的代码,遗憾的是我没有时间进行编辑,因此您可以使用工具进行比较。

    成品,经过大约 2 小时的工作:

    <table style="width: 600px;" align="center" cellpadding="0" cellspacing="0" border="0" >
                    <tr>
                        <td background="http://timshoemake.io/wp-content/uploads/email-template/prowler3.png"  style="line-height:10px; background-image:url('http://timshoemake.io/wp-content/uploads/email-template/prowler3.png'); background-size: cover; -webkit-background-size: cover; -moz-background-size: cover -o-background-size: cover; background-position: center; background-repeat: no-repeat;" >
    
                        <table width="70" align="left" border="0" cellpadding="0" cellspacing="0" >
                            <tr>
                                <td width="40px"> &nbsp;&nbsp;&nbsp;&nbsp; </td>
                                <td height="70" style="padding: 0 20px 20px 0;">
                                    <img src="http://timshoemake.io/wp-content/uploads/email-template/shoemaker_repair_blue@2x-2.png"  style="height: auto; "width="70" height="70" border="0" alt="" / >
                                </td>
                                <td>
                                    <!--[if (gte mso 9)|(IE)]>
                                    <table width="425" align="left" cellpadding="0" cellspacing="0" border="0">
                                        <tr>
                                            <td>
                                            <![endif]-->
                                                <table align="left" border="0" cellpadding="0" cellspacing="0" style="width: 425px; width: 100%; max-width: 425px;">
    
                                                    <!-- top padding -->
                                                    <tr>
                                                        <td width="600px" height="40px"></td>
                                                    </tr>
    
                                                    <!-- header content -->
                                                    <tr>
                                                        <td height="70">
                                                        <table width="425px" border="0" cellspacing="0" cellpadding="0" style="font-family: 'Raleway', Helvetica, Arial, sans-serif;" >
                                                            <tr>
    
                                                                <td style="font-size: 15px; color: #ffffff; font-family: sans-serif; letter-spacing: 10px; padding: 0 0 0 3px;">
                                                                    Creating
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td style="font-size: 30px; line-height: 38px; font-weight: bold; color: #ffffff; padding: 5px 0 0 0;">
                                                                    Beautiful Fitness Web Design
                                                                </td>
                                                                <!-- <td width="20px"></td> -->
                                                            </tr>
                                                        </table>
                                                        </td>
                                                    </tr>
    
                                                    <!-- bottom padding -->
                                                    <tr>
                                                        <td width="600px" height="40px"></td>
    
                                                    </tr>
                                                </table>
                                </td>
                                            <!--[if (gte mso 9)|(IE)]>
                                            </td>
                                        </tr>
                                    </table>
                                    <![endif]-->
                            </tr>
                        </table>
                        </td>
                    </tr>
    </table>
    

    【讨论】:

    猜你喜欢
    • 2019-09-18
    • 2017-05-14
    • 1970-01-01
    • 1970-01-01
    • 2017-01-04
    • 2011-03-02
    • 1970-01-01
    • 2013-03-12
    • 1970-01-01
    相关资源
    最近更新 更多