HTML电子邮件模板解决方案到表TD中的javascript链接



这是我当前的代码:

<td height="150" style="background: url(bg.jpg); cursor: pointer;" onClick="document.location.href='http://www.youtube.com';">

现在很明显,使用JavaScript,这不太可能在电子邮件客户端中工作(是吗?)。什么是HTML解决方案?提前感谢!我试过将链接标签包装起来,但似乎没有效果。

为什么不设计一个链接的样式来占用td:的宽度和高度

<td height="150" style="background: url(bg.jpg);"><a href="http://www.youtube.com" style="display:block;height:150px;width:100%;"></a></td>

考虑到您发布的信息(以及您对@PAM答案的评论),我认为这将解决您的问题:

<td width="150" style="background-color:rgb(128,128,128); background-image:url('http://www.yoursite.com/yourpicture.gif'); cursor:pointer;">
<a href="http://www.youtube.com">
...Text...
</a>
</td>

我在td中添加了background-color属性,这样,如果用户的电子邮件客户端不显示背景图像,用户就可以回退。当然,您应该将其设置为与背景图像相似的颜色。

你不能这样打字吗:

<td height="150"><a href="http://www.youtube.com"><img src="bg.jpg" /></a></td>

最新更新