媒体查询以覆盖内联CSS

时间:2014-12-10 15:14:48

标签: html css media-queries inline

我正在尝试使用媒体查询覆盖电子邮件中的内联CSS。我能够让表调整大小,但我无法改变字体样式。下面是我的CSS代码以及我尝试将其放在表中的位置。另外,我正在使用评论功能吗?我相信我也见过/ *评论* /

@media screen and (max-device-width: 500px) {

table [class="wrapper"] {
    width: 100% !important;
}

td [class="headerText"] {
 font-size:11px !important;
 font-family:Georgia, "Times New Roman", Times, serif !important;
 color:#000000 !important;
}
<!--Content header-->
<table width="100%" border="0" class="content">
  <tr  align="center">
    <td class="headerText">
<span style="font-family:Georgia, 'Times New Roman', Times, serif; font-size:19px; color:##C03333">Sophisticated Sparkle <em>for the</em> Holidays</span>
</td>
</tr>
</table>

1 个答案:

答案 0 :(得分:2)

就这样做

td.headerText span  {
 font-size: 14px!important; /* adjust as needed */
 font-family: Georgia, "Times New Roman", Times, serif !important;
 color: green!important;
}

td[class="headerText"] span { 
 font-size: 14px!important;
 font-family:Georgia, "Times New Roman", Times, serif !important;
 color:#000000 !important;
}

对于第二段代码, td [

之间不应该有空格

See the second block of code working here