Bootstrapmail Gmail-mobile-webapp 不支持 `display: none`

发布于 2025-01-15 17:28:37 字数 1543 浏览 4 评论 0 原文

我使用 bootstrapmail 来制作电子邮件。但我在使用 Gmail 移动网络邮件时遇到问题。 用户图标不得显示在移动设备上。但这里它显示在标题中的徽标中。

它不响应:display: none;。当标头变小时,它还会忽略 bootstrap-email 的 col-lg 类。大家可以帮助我吗?

这是我的代码:

<!DOCTYPE html>
<html lang="nl">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style type="text/css">

    </style>
</head>
<body class="bg-gray-200">
    <div class="container">

        <!-- Header Begin -->
        <div class="w-full p-4 bg-black">
          <div class="row">
            <div class="col-lg-10">
                <!-- Logo of Voetbalshop.nl -->
                <img class="h-12 ay-middle" src="#">
            </div>
            
            <div class="col-lg-2 ay-middle ax-right">
                <!-- User Icon redirect to login page of Voetbalshop.nl when clicked on -->
                <a class="no-underline" href="#">
                    <img class="w-7 d-none d-lg-inline ay-middle" src="#">
                </a>
            </div>
          </div>
        </div>
        <!-- Header End -->

在下图中,您可以看到它现在的样子。

输入图片此处描述

I use bootstrapemail to make my e-mails. But with I have problems with Gmail Mobile Webmail.
The user-icon must not be shown on mobile devices. But here it is shown in the logo in the header.

It doesn't respond to: display: none;. Also it ignores the col-lg classes of bootstrap-email when the header becomes to small. Can eneyone help me?

This is my code:

<!DOCTYPE html>
<html lang="nl">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style type="text/css">

    </style>
</head>
<body class="bg-gray-200">
    <div class="container">

        <!-- Header Begin -->
        <div class="w-full p-4 bg-black">
          <div class="row">
            <div class="col-lg-10">
                <!-- Logo of Voetbalshop.nl -->
                <img class="h-12 ay-middle" src="#">
            </div>
            
            <div class="col-lg-2 ay-middle ax-right">
                <!-- User Icon redirect to login page of Voetbalshop.nl when clicked on -->
                <a class="no-underline" href="#">
                    <img class="w-7 d-none d-lg-inline ay-middle" src="#">
                </a>
            </div>
          </div>
        </div>
        <!-- Header End -->

In the image below tou can see what it looks like now.

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

幸福还没到 2025-01-22 17:28:37

Gmail 移动网络邮件不支持 Display:none(但使用它的人比例极小 - 它不是 Gmail 移动应用程序):https://www.caniemail.com/clients/gmail/#mobile-webmail

它也不支持

您可以尝试添加自己的样式,例如 style="width:0;height:0;" (内联在图像上),然后添加自定义嵌入样式以在桌面中显示它,例如 < ;style>@media screen 和 (min-width:600px) {img .d-none {width:50px!important;height:50px!important;} }。 (警告:有一些较少使用的桌面应用程序不支持

Display:none is not supported on Gmail Mobile Webmail (but that's an extremely tiny percentage of people who use that - it is not the Gmail Mobile Apps): https://www.caniemail.com/clients/gmail/#mobile-webmail

It also doesn't support <style> blocks, along with Gmail IMAP (a type of Gmail account used a lot more): https://www.caniemail.com/features/html-style/. So since Bootstrap Email relies on @media queries in the <style> block for responsive behaviour, you won't be able to get responsive classes working in these clients (basically every other mobile client supports it).

You could try adding your own styles like style="width:0;height:0;" (inline on the image) and then adding a custom embedded style to show it in desktops like <style>@media screen and (min-width:600px) {img .d-none {width:50px!important;height:50px!important;} }</style>. (Caveat: there are a couple of less-used desktop applications that don't support the <style> block, and you'll have to do something about Outlook, but you can use their conditional block for that)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文