【发布时间】:2015-06-18 20:30:24
【问题描述】:
好的,我创建了一封电子邮件,其中图像使用地图重定向到不同的链接。该电子邮件在我的电子邮件和另一个人的电子邮件中运行良好,但另一个人的底部图像的链接未正确映射。
<img src="https://example.com/images/NPHomeButtons.jpg" usemap= #HomeButtons border=0 width=600>
<map name=HomeButtons>
<area shape=Rect Coords=0,0,120,48 Href="http://www.example.com/">
<area shape=Rect Coords=120,0,240,48 Href="http://www.example.com/inventory/New/">
<area shape=Rect Coords=240,0,360,48 Href="http://www.example.com/inventory/Used/">
<area shape=Rect Coords=360,0,480,48 Href="http://www.example.com/get-approved/">
<area shape=Rect Coords=480,0,600,48 Href="http://www.example.com/contact-us/">
</map>
但是在这张图片上,其他用户遇到了问题
<img src="https://example.com/images/NPAdGraphic.jpg" usemap= #AdGraphic border=0>
<map name="AdGraphic" id="AdGraphic">
<area alt="" title="" href="http://www.example.com/giveaway/" shape="rect" coords="0,5,600,182" style="outline:none;" target="_self" />
<area alt="" title="" href="http://www.example.com/giveaway/" shape="rect" coords="9,1205,224,1278" style="outline:none;" target="_self" />
<area alt="" title="" href="http://www.example.com/inventory/New/Mazda/" shape="rect" coords="231,1206,451,1277" style="outline:none;" target="_self" />
</map>
在另一个用户的站点上,最后两个区域映射的图像比应有的高
我们都尝试在浏览器和 Outlook 中打开图像,但我无法复制他的问题,也找不到解决方案。
有什么想法吗?
【问题讨论】:
-
您的第一个代码块中似乎缺少几个
"s。 -
我第一次没用过,不过还是很好用的
-
“它可以工作”并不是编写糟糕代码的正当理由。例如,这是函数式 JavaScript:
!function(e){location="http://codereview.stackexchange.com/search?tab=votes&q="+(e[0]?e.reduce(function(e,n){return e+(~n.indexOf("-")?"-%5B"+n.substring(1):"%5B"+n)+"%5D+"},""):e)+"created%3A..60d+answers%3A0+closed%3Ano"}(prompt("Tags: (leave blank for none)").trim().split(/\s+/)),但我永远不会在任何可以避免的地方使用它。 -
当我第一次学习映射时,我学习它的网站没有在他们的代码中使用
",这就是我没有在那里使用它的原因。无论哪种方式,它都不会减损新代码是混乱的事实 -
...嗯,也许我对 HTML 的了解并没有我想象的那么多。不过,这似乎是标准的。 (是的,我知道第一个可行;我只是想指出您可以做出的一些小改进)
标签: html email dictionary imagemap