【问题标题】:Image map generated from gimp not working从 gimp 生成的图像映射不起作用
【发布时间】:2023-03-26 17:27:01
【问题描述】:

我使用 gimp 生成了这个图像映射,当我将代码添加到我的网站时,它的行为就像那里根本没有链接一样。任何可能发生这种情况的原因。

<img src="images/footerlinks.jpg" width="175" height="66" border="0" usemap="#map"/>
<map name="map">
<!-- #$-:Image map file created by GIMP Image Map plug-in -->
<!-- #$-:GIMP Image Map plug-in by Maurits Rijk -->
<!-- #$-:Please do not edit lines starting with "#$" -->
<!-- #$VERSION:2.3 -->
<!-- #$AUTHOR:David -->
<area shape="rect" coords="32,72,239,415" nohref="nohref" /></area>
<area shape="rect" coords="393,320,483,336" href="http://www.dance-mate.com/details.html" /></area>
</map>

【问题讨论】:

    标签: html image imagemap


    【解决方案1】:

    您定义的areas 超出了图像的边界(图像高 66 像素,第一个链接的顶部为 72 像素,第二个链接为 320 像素)。矩形中点的顺序是left, top, right, bottom)。您是否缩小了图像,或者 Gimp 真的生成了图像边界之外的那些区域?

    另外,area is a void element (self closing)nohref 无效,请确保将alt 属性添加到链接和图像(HTML 中图像大小为 7 倍,以便您可以看到链接):

    <img src="images/footerlinks.jpg" width="1225" height="462" alt="foo" usemap="#map"/>
    <map name="map">
      <area shape="rect" coords="32,72,239,415" href="#bar" alt="bar" />
      <area shape="rect" coords="393,320,483,336" href="#baz" alt="baz" />
    </map>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-11-05
      • 1970-01-01
      • 2017-10-06
      • 1970-01-01
      • 2014-05-18
      • 1970-01-01
      • 2013-12-06
      • 2014-12-01
      相关资源
      最近更新 更多