会社の電子メール テンプレートを作成しています。モバイルかブラウザかに応じて、コンテンツを表示しようとしています。
表示属性が gmail で機能しないようです。ここにコード全体を貼り付けることはできません。これは私が使用するメディアクエリです。
@media only screen and (max-device-width: 380px) {
.mobileWidth {
width: 290px !important;
}
img {
max-width: 130px !important;
max-height: 130px !important;
}
.right {
width: 100% !important;
position: relative !important;
}
.test {
width: 290px !important;
text-align: center !important;
}
.showMobile {
display:inline !important;
}
.hideMobile {
display: none;
}
}
<html>
<body>
<!-- this div block is intended to by default not show in the browser and show in the mobile -->
<table>
<tr>
<td>
<div class = "showMobile" style ="display:none;">
<p> some text and image <p>
</div>
<!-- this div block is intended to be shown in the browser and not shown in the mobile -->
<div class="hideMobile">
<p> some other text and image </p>
</div>
</td>
</tr>
</table>
</body>
</html>
これは、iPhone メール アカウントでは正常に機能しますが、Gmail ブラウザや iPhone 用の Gmail アプリでは機能しません。ポインタはありますか?