Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2008/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mobile 在移动电子邮件中选择第n个子元素_Mobile_Html Email_Css Selectors - Fatal编程技术网

Mobile 在移动电子邮件中选择第n个子元素

Mobile 在移动电子邮件中选择第n个子元素,mobile,html-email,css-selectors,Mobile,Html Email,Css Selectors,我正试图为我们从广告服务中收到的回复邮件中看到的一些问题提供备份。偶尔,我们的广告会附带一个第三方脚本,其中包含1x1跟踪像素。我们使用全局规则来调整图像的大小。。。img{width:100%;height:auto;}我们无法使用类或id来定位这个跟踪像素。我正在考虑至少在移动设备上使用第n个子选择器来正确调整跟踪像素的大小,因为它们可以在很大程度上支持这种CSS,尽管我没有正确编写它。任何帮助都将不胜感激 HTML: 第n个子类和其他CSS伪类在html电子邮件中。最好的办法是创建一个小

我正试图为我们从广告服务中收到的回复邮件中看到的一些问题提供备份。偶尔,我们的广告会附带一个第三方脚本,其中包含1x1跟踪像素。我们使用全局规则来调整图像的大小。。。img{width:100%;height:auto;}我们无法使用类或id来定位这个跟踪像素。我正在考虑至少在移动设备上使用第n个子选择器来正确调整跟踪像素的大小,因为它们可以在很大程度上支持这种CSS,尽管我没有正确编写它。任何帮助都将不胜感激

HTML:


第n个子类和其他CSS伪类在html电子邮件中。最好的办法是创建一个小表,并将跟踪链接/图像放在其中。1像素的100%是1像素

如果您无法选择跟踪代码的放置位置(例如,在发送时动态添加),则必须重新考虑自动100%策略

另外,请记住,在样式标记中声明100%也不完全受支持-您应该内联CSS

<td align="center" bgcolor="#ffffff" class="ad-728">
    <font style="font-family:Arial,Helvetica,sans-serif;color:#858585;font-size:10px;text-transform:uppercase;line-height:13px;display:block;" align="center">Advertisement</font>
    <table>
        <tbody>
            <tr>
                <td width="100%" height="2" style="line-height:2px;font-size:2px;">&nbsp;</td>
            </tr>
        </tbody>
    </table>
    <a href="http://oascentral.modernhealthcare.com/RealMedia/ads/click_lx.ads/mhoemail/jcr_dd_1113/102920131102/x19/crain/MHO_EZ_JOINTCOMM_DD_728_1113/Savelivessavemoney-Ad_ModernHealthcare_10-11-2013-2.jpg/1" target="_blank">
        <img src="http://oascentral.modernhealthcare.com/RealMedia/ads/adstream_nx.ads/mhoemail/jcr
_dd_1113/102920131102@x19" border="0"/>
    </a>
    <a href="#">
        <img src="http://placehold.it/1x1/"/>
    </a>
</td>
img {width:100%;height:auto;}
td[class="ad-728"] img:nth-child(n+2) {width:1px!important;max-width:1px!important;}