出于某种原因,我发送电子邮件时我的媒体查询不适用.我将它从Outlook 2007发送到gmail并使用iphone 4s查看它.我尝试使用更简单的@media查询规则发送测试电子邮件(即只更改字体颜色的媒体查询),但这些也不起作用.此外,我尝试从教程中发送演示HTML电子邮件(例如:http://www.netmagazine.com/tutorials/build-responsive-emails),但媒体查询也被忽略了
我在下面附上了我的代码的开头:
<!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="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Sample</title>
<style type="text/css">
@media only screen and (max-width: 480px) {
table[class="contenttable"] {
width:400px !important;
text-align: left !important;
}
table[class="contenttable2"] {
width: 382px !important;
text-align: left !important;
}
td[class="changer"] {
width:382px !important;
height: 10px !important;
}
td[class="autoalign"] {
padding: 0 !important;
text-align: center !important;
}
img[class="logo"] {
margin-left: -10px !important;
}
td[class="autotext"] { …Run Code Online (Sandbox Code Playgroud)