【问题标题】:Formatted email in htmlhtml 格式的电子邮件
【发布时间】:2014-07-18 12:52:43
【问题描述】:

我有一个这样的html:

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<html>
    <body>
        <p class="MsoNormal" style="line-height:13.5pt;background:white">
        <b><span style="font-size:10.5pt;font-family:Arial,sans-serif;color:#ff6600">My Text</span></b>
           <span style="font-size:10.5pt;font-family:Arial,sans-serif;color:#323232"><u></u><u></u></span>
        </p>

        <p class="MsoNormal">
            <span style="font-size:10.5pt;font-family:Arial,sans-serif;color:#323232;background:white">My Text</span>
            <span style="font-size:10.5pt;font-family:Arial,sans-serif;color:#323232">
            <br>
            <span style="background:white">My Text</span>
            <br><span style="background:white">My Text</span><br>
            <span style="background:white">My Text</span><br>
            <span style="background:white">My Text<u></u><u></u></span></span>
        </p>
            <p class="MsoNormal" style="line-height:13.5pt">
            <b><span style="font-size:10.5pt;font-family:Arial,sans-serif;color:#ff6600">My Text</span></b><br />
            <span style="font-size:10.5pt;font-family:Arial,sans-serif;color:#323232">%@<u></u><u></u></span>
        </p>
           <p class="MsoNormal" style="line-height:13.5pt">
           <b>
               <span style="font-size:10.5pt;font-family:Arial,sans-serif;color:#ff6600">My Text</span></b><br />
                <span style="font-size:10.5pt;font-family:Arial,sans-serif;color:#323232">My Text<u></u><u></u></span><br />
        </p>

        <p class="MsoNormal" style="line-height:13.5pt;background:white">
            <b><span style="font-size:10.5pt;font-family:Arial,sans-serif;color:#ff6600">My Text</span></b>
        </p>

        <span style="font-size:10.5pt;font-family:Arial,sans-serif;color:#323232">My Text</span><br/>
        <span style="font-size:10.5pt;font-family:Arial,sans-serif;color:#323232">My Text</span><br/>
        <span style="font-size:10.5pt;font-family:Arial,sans-serif;color:#323232">7My Text</span><br/><br/>
    </body>
</html>

这在我的浏览器 (Google Chrome) 中运行良好。 ("正确的.png")

当我用我的 iOS 应用程序使用这个 html 发送格式化的电子邮件时,在我的计算机中接收邮件时的结果是不一样的。 (“NotCorrect.png”)。

如何解决这个问题?谢谢

【问题讨论】:

    标签: html css iphone


    【解决方案1】:

    你需要插入不同的浏览器webkits:

    受带有前缀 -ms- 的 Internet Explorer 支持

    Firefox 支持,前缀为 -moz-

    由带有前缀 -webkit- 的 Google Chrome 支持

    Safari 支持,前缀为 -webkit-

    Opera 支持,前缀为 -webkit-

    我建议您添加样式表,因为它会使您的代码更难阅读和评估

    Safari 是 iOS 浏览器

    【讨论】:

    • 你能给我一个例子如何插入一个前缀吗? Tnaks
    • w3schools.com/cssref/css3_browsersupport.asp 这里有一个浏览器支持列表,但一个例子是-webkit-border-top-right-radius: 20px; -moz-border-radius-topright: 20px; border-top-right-radius: 20px;
    • 它们只是示例,尽管它们并不针对您的问题