반응이 매우 빠른 HTML 전자 메일 템플릿을 테스트하고 있으며 Gmail (Android)이 미디어 쿼리를 무시하고 있습니다.반응 형 HTML 전자 메일 - 클래스 추가 Gmail
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="format-detection" content="telephone=no">
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=no;">
<meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE" />
<style type="text/css">@media screen and (max-width:580px) {
*[class="mob-column"] {float: none!important; width: 100%!important;}
*[class="hide"] {display:none!important;}
*[class="100p"] {width:100%!important; height:auto!important;}
}</style>
<title>Website</title>
</head>
<body>
<table class="100p" width="100%" cellpadding="10" cellspacing="0" bgcolor='#ffffff'>
<tr>
<td valign="top" align="center">
<table class="100p" width="650" cellpadding="0" cellspacing="0" bgcolor="#ffffff">
<tr>
<td class="mob-column" width="325" align="left" valign="middle">
<img src="https://www.website.com/img/logo.png" alt="website" width="200" height="26" border="0"/></td>
<td class="hide" width="325" valign="middle" align="right">
<span style="font-size:12px;color:#c5c5c5;font-family:Helvetica,Arial,sans-serif;">Having trouble viewing this email? <a style="color:#666666; text-decoration:none;" href="#">click here</a></span>
</td>
</tr>
<tr>
<td class="mob-column" align="left" valign="middle" colspan="2" height="30" style="padding-left: 15px;">
<span style="font-size:12px; font-family:Helvetica,Arial,sans-serif;"><a style="color:#c5c5c5; text-decoration:none;" href="tel:111111111">111111111</a><span style="color: #c5c5c5;"> | </span><a style="color:#c5c5c5; text-decoration:none;" href="tel:111111111">111111111</a></span>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
그래서 클래스 mob-column
이 테이블 셀 스택해야하고, hide
테이블 셀을 숨겨야합니다 :
여기 내 아주 기본적인 테스트 마크 업입니다. 아직이 기능은 Android 용 Gmail에서 완전히 무시되고 있습니다.
내가 바탕 화면에 Gmail의 HTML을 검사 할 때 나는 클래스과 같이 변경된 것을 확인할 수 있습니다
mob-column
이 m_1371211720454434058mob-column
hide
로 변경됩니다 m_1371211720454434058hide
로 변경 내가 튜토리얼이 따랐습니다 Litmus (https://litmus.com/community/learning/24-how-to-code-a-responsive-email-from-scratch)에서 시험을 위해 https://putsmail.com을 사용하고 있습니다.
어디서이 문제가 발생합니까?
약 1 년 전에 Gmail이 포함 된 스타일 시트 및 미디어 쿼리에 대한 지원을 추가하기 위해 업데이트되었습니다. 이제는 모두 좋았습니다. – Gwesolo