Css 响应电子邮件中的媒体查询不工作
我的响应电子邮件的简单代码不起作用。当我在android或dreamweaver上预览它时,它仍然是600像素,我得到了滚动条。我不想在gmail或雅虎上看到它。我做错了什么或遗漏了什么Css 响应电子邮件中的媒体查询不工作,css,email,media,Css,Email,Media,我的响应电子邮件的简单代码不起作用。当我在android或dreamweaver上预览它时,它仍然是600像素,我得到了滚动条。我不想在gmail或雅虎上看到它。我做错了什么或遗漏了什么 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1 /DTD/xhtml1-transitional.dtd"> <html xmlns="http://w
<!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" />
<title>Untitled Document</title>
<style type="text/css" data-premailer="ignore">
@media screen and (max-width:550px) {
table[class="wrapper"] {
width: 100% !important;
}
td[id="content"] {
width: 100% !important;
}
img[class="tulips”] {
width:100% !important;
height: auto !important;
}
}
</style>
</head>
<body>
<table width="600" border="0" class="wrapper">
<tr>
<td>
<table width="100%" border="0">
<tr>
<td id="content">hello</td>
</tr>
</table>
<table width="100%" border="0">
<tr>
<td id="content"><img src="https://lh3.googleusercontent.com/-EfoZBXkd-H0/VIcj6laLtaI/AAAAAAAAAhM/z67q37qNBho/w600-h438-no/images-12-9-14.jpg" alt="Tulips" width="600 px" style="display: block; padding: 0" class="tulips"></td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
无标题文件
@媒体屏幕和屏幕(最大宽度:550px){
表[class=“wrapper”]{
宽度:100%!重要;
}
td[id=“content”]{
宽度:100%!重要;
}
img[class=“郁金香”]{
宽度:100%!重要;
高度:自动!重要;
}
}
你好
查看您的css,查看您的img标签。郁金香后面的引号是错误的种类。将其更改为:
img[class="tulips"] {
width:100% !important;
height: auto !important;
}