所以我有这个应该响应的html电子邮件,我正在使用媒体查询并搜索一个答案,但似乎没有任何东西可以完成这项工作。基本上问题是我希望电子邮件的文本部分改变它的宽度,但它没有这样做(颜色正在改变,我把它放在那里检查是否是媒体查询没有被执行。我是猜测这是一个HTML问题,但我不能完成任务。任何帮助都会受到赞赏。这是我的HTML:
<html>
<body>
<table class="container" width="600" align="center">
<tr>
<td>
<div class="header">
<img src="www.testimg.com" width="600" height="200">
</div>
<table class="textAreaT">
<tr>
<td>
<div class="textarea">Sample text which is supposed to be shrinking in smaller screens but certainly isn't. Color is changing so no idea why the width is not working as expected. HELP!!</div>
</td>
</tr>
</table>
<div class="footer"></div>
<div class="disclaimer">
©2015 Marinello Schools of Beauty, All rights reserved.
</div>
</td>
</tr>
</table>
</body>
</html>
这也是我的css:
<style type="text/css">
body {
font: 100%/1.4 Verdana, Arial, Helvetica, sans-serif;
background-color: #FFFFFF;
margin: 0;
padding: 0;
color: #000;
}
h1 {
font-face: 100%/1.4 Verdana, Arial, Helvetica, sans-serif;
color: #004586;
font-weight: bolder;
font-size: 17px;
}
h2 {
font-face: 100%/1.4 Verdana, Arial, Helvetica, sans-serif;
color: #004586;
font-weight: bolder;
font-size: 15px;
}
span {
font-face: 100%/1.4 Verdana, Arial, Helvetica, sans-serif;
font-color: #000;
font-size: 13px;
line-height: 145%;
}
ul, li {
font-face: 100%/1.4 Verdana, Arial, Helvetica, sans-serif;
color: #004586;
font-size: 14px;
font-weight: bold;
padding-top: 5px;
padding-bottom: 5px;
}
.container {
width: 600px;
background-color: #FFFFFF;
}
a img {
border: none;
}
a:link {
color: #004586;
text-decoration: underline;
}
a:visited {
color: #004586;
text-decoration: underline;
}
a:hover {
color: #666666;
text-decoration: underline;
}
a:active {
color: #000;
text-decoration: underline;
}
.header {
width: 100%;
background-color: #FFFFFF;
border-color: #004586;
border-bottom-style: solid;
border-width: 1px;
margin-top: 30px;
margin-right: auto;
margin-bottom: 25px;
margin-left: auto;
padding-bottom: 20px;
}
.textarea {
width: 600px;
background-color: #FFFFFF;
margin-bottom: 12px;
margin-right: auto;
margin-left: auto;
}
@media only screen and (max-width: 600px) {
.textarea {
max-width: 450px !important;
width: 450px !important;
background-color: #FFFFFF;
margin-bottom: 12px;
margin-right: auto;
margin-left: auto;
color: red !impotant;
}
.container {
width: 100% !important;
}
.textAreaT {
max-width: 450px !important;
width: 450px !important;
background-color: #FFFFFF;
margin-bottom: 12px;
margin-right: auto;
margin-left: auto;
}
}
@media only screen and (max-device-width: 600px) {
.textarea {
max-width: 450px !important;
width: 450px !important;
background-color: #FFFFFF;
margin-bottom: 12px;
margin-right: auto;
margin-left: auto;
color: red !impotant;
}
.container {
width: 100% !important;
}
.textAreaT {
max-width: 450px !important;
width: 450px !important;
background-color: #FFFFFF;
margin-bottom: 12px;
margin-right: auto;
margin-left: auto;
}
}
<!--
.footercontainer {
width: 600px;
background-color: #FFFFFF;
border-color: #004586;
border-top-style: solid;
border-width: 1px;
margin-top: 40px;
margin-right: auto;
margin-left: auto;
padding-top: 10px;
position: relative;
}
-->
.footer {
width: 600px;
background-color: #FFFFFF;
border-color: #004586;
border-top-style: solid;
border-bottom-style: solid;
border-width: 1px;
padding-top: 10px;
padding-bottom: 10px;
margin: 0 auto;
}
.disclaimer {
width: 600px;
background-color: #FFFFFF;
font-face: 100%/1.4 Verdana, Arial, Helvetica, sans-serif;
color: #000000;
font-size: 8px;
margin: 0 auto;
padding-top: 15px;
text-align: center;
}
</style>
再次,伙计们,非常感谢您提供的任何帮助。
PD:我正在Android 2.3和4.2(Litmus)中进行测试