微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Gmail 的媒体查询问题

如何解决Gmail 的媒体查询问题

我在使用响应式电子邮件时遇到了一些问题。我想处理 gmail。

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <Meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <Meta name="viewport" content="width=device-width,initial-scale=1.0"/>
    <title>Your Message Subject or Title</title>
    <style type="text/css">
        @media only screen and (max-device-width: 640px) {
            div[class="hidden"]{display: none !important;visibility: hidden;}
            .hidden{display: none !important;visibility: hidden;}
        }
        @media only screen and (min-device-width: 641px) {
            div[class="shown-on-mobile"]{display: none !important;visibility: hidden;}
            .shown-on-mobile{display: none !important;visibility: hidden;}
        }

        @media only screen and (max-width: 640px) {
            div[class="hidden"]{display: none !important;visibility: hidden;}
            .hidden{display: none !important;visibility: hidden;}
        }
        @media only screen and (min-width: 641px) {
            div[class="shown-on-mobile"]{display: none !important;visibility: hidden;}
            .shown-on-mobile{display: none !important;visibility: hidden;}
        }
    </style>
</head>
<body>
    <div class="hidden">
        test desktop
    </div>
    <div class="shown-on-mobile">
        test mobile
    </div>
</body>
</html>

在这种情况下,当我在 Gmail 桌面版中打开邮件时,我可以看到“测试桌面版”和“测试移动版”。我不明白为什么显示“测试手机”。此外,gmail 删除了我的 div 上的 css 类。 预先感谢您的帮助。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。