在HTML邮件中,Gmail的背景颜色无法正常工作
P粉344355715
P粉344355715 2023-08-16 14:55:54
0
1
442
<p>2023年8月 - 有人有一个在Gmail中可以正常工作的创建带有整个邮件正文背景颜色的简单示例吗?我已经到处寻找,截至2023年8月,没有一个代码示例在Gmail中有效。希望有人能分享一个从<body>到</body>的小片段,截至2023年8月在Gmail中有效。我将永远感激不尽。</p> <p>我尝试了无数的选项,但绝对没有一个有效。</p>
P粉344355715
P粉344355715

全部回复(1)
P粉155128211

希望这对你有帮助:

<!-- width: calc((480px - 100%) * 480); -->
<table cellpadding="0" cellspacing="0" style="margin:auto; max-width:600px; width: 100%; font-size: 0; border-collapse: collapse;">
    <tr>
        <td>
            <h1 style="margin: 0; padding: 0; font-size: 30px; text-align:center; background: #e1c18b; color: #643c33; line-height: 2;">与我自拍</h1>
        </td>
    </tr>
    <tr>
        <td>
            <img src="https://image.freepik.com/free-photo/camera-mirror_446-19322773.jpg" style="max-width: 100%; display: inline-block; vertical-align:top;" alt="Hero Image" />
        </td>
    </tr>
    <tr>
        <td style="background: #322421;">
            <table cellpadding="10" cellspacing="0" style="width: calc((480px - 100%) * 480); min-width: 50%; max-width: 100%;  font-family: arial; font-size: 14px; display: inline-block;">
                <tr>
                    <td>
                        <img src="https://image.freepik.com/free-photo/young-hipster-woman-making-photos-with-vintage-film-camera-at-summer-field-women-lifestyle-concept_1150-1054.jpg" alt="" style="width: 100%; display: inline-block; vertical-align: top;" />
                        <p style="padding: 10px 0; margin: 0; text-align: justify; color: #f6e2c0;">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nostrum praesentium ipsa vero consequuntur sunt porro vitae, a sed fuga debitis ratione, quas mollitia voluptate, ad voluptatum repellat voluptates! At, doloribus.</p>
                    </td>
                </tr>
            </table>
            <table cellpadding="10" cellspacing="0" style="width: calc((480px - 100%) * 480); min-width: 50%; max-width: 100%;  font-family: arial; font-size: 14px; display: inline-block;">
                <tr>
                    <td>
                        <img src="https://image.freepik.com/free-photo/young-hipster-woman-making-photos-with-vintage-film-camera-at-summer-field-women-lifestyle-concept_1150-1054.jpg" alt="" style="width: 100%; display: inline-block; vertical-align: top;">
                        <p style="padding: 10px 0; margin: 0; text-align: justify; color: #f6e2c0;">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nostrum praesentium ipsa vero consequuntur sunt porro vitae, a sed fuga debitis ratione, quas mollitia voluptate, ad voluptatum repellat voluptates! At, doloribus.</p>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
    <tr>
        <td style="margin: 0; padding: 10px; font-size: 20px; text-align:center; background: #564037; color: #ffffff;">
            成为自拍专家
        </td>
    </tr>
</table>
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板