加入收藏 | 设为首页 | 会员中心 | 我要投稿 安卓应用网 (https://www.0791zz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > PHP > 正文

php – 在Gmail电子邮件中删除了Flex-box属性

发布时间:2020-05-22 15:31:04 所属栏目:PHP 来源:互联网
导读:我有一个 PHP脚本,通过邮件发送以下HTML: html class=no-js lang=en body div style=width: 70%;background-color: #060b2b;margin: auto;flex-direction: column;display: flex; h1 style=margin

我有一个 PHP脚本,通过邮件发送以下HTML:

<html class="no-js" lang="en">
   <body>
      <div style="width: 70%;background-color: #060b2b;margin: auto;flex-direction: column;display: flex;">

        <h1 style="margin-top: 50px;color: white;margin-left: auto;margin-right: auto;">Vous avez reu une nouvelle notification.</h1>

        <div style="width: 80%;padding: 50px;margin-top: 50px;background-color: #222;margin-left: auto;margin-right: auto;display: flex;">
            <p style="color:white;margin: auto;text-align: center;">{{$notification}}</p>
        </div>

        <a href="" style="margin-top: 50px;margin-bottom: 50px;margin-left: auto;margin-right: auto;color: white;padding:15px;background-color: #0E0E0E;">Accéder à mon compte</a>
      </div>
   </body>
</html>

但收到的电子邮件(当我检查主要div时)没有显示属性flex-direction:列;

似乎gmail过滤了那些属性?

这是正常的吗?

设计HTML电子邮件与设计HTML网站不同.电子邮件客户端和Web浏览器之间存在巨大的技术差距.好像浏览器在不断发展,但电子邮件客户端在1998年陷入困境.

在HTML电子邮件的世界中,嵌入式和外部样式都很糟糕,CSS3很糟糕,JavaScript很糟糕,而内联样式和表格布局都很好.在这个世界上,老派的编码方法仍然充满活力.

Gmail将剥离CSS3属性并不奇怪.您最好的选择是坚持表格和内联样式.

更新:Gmail now supports embedded styles.

更多信息:

> CSS in HTML Email
> Best practices for styling HTML emails
> Best Practices & Considerations when writing HTML Emails

(编辑:安卓应用网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读