html 地图不工作

发布于 2024-12-11 05:33:49 字数 1459 浏览 0 评论 0原文

对于我为工作制作的网站,我想主要使用 CSS 编码,但是当我看到涉及 CSS 地图的所有问题时,我采纳了其他人的建议,并坚持使用传统的 HTML 地图样式。但是,映射代码将不起作用,链接仍然无法单击。我不确定这是否是 CSS/HTML 组合的问题,但我的 HTML 部分代码如下:

<body>
<div id="header">
    <div id="menu">
        <img src="http://i74.photobucket.com/albums/i266/nanashiwolf/header.png" width="770" height="100" alt="logo" border="0" usemap="#headermap" />

<map name="#headermap">
  <area shape="rect" coords="156,67,156,83,225,83,225,67" href="links.html" alt="Links" />
  <area shape="rect" coords="239,67,239,83,309,83,309,67" href="links.html" alt="Links" />
  <area shape="rect" coords="324,67,324,83,392,83,392,67" href="links.html" alt="Links" />
  <area shape="rect" coords="403,67,403,83,511,83,511,67" href="links.html" alt="Links" />
  <area shape="rect" coords="526,67,526,83,588,83,588,67" href="links.html" alt="Links" />
  <area shape="rect" coords="602,67,602,83,662,83,662,67" href="links.html" alt="Links" />
  <area shape="rect" coords="675,67,675,83,736,83,736,67" href="links.html" alt="Links" />
</map>
    </div></div>

紧随其后的是网站正文的另一个开放 div,据我所知没有问题。我在想也许这是菜单标签的问题,但这就是我对菜单的全部内容:

#menu {

    float: left;
    width: 767px;
    height: 200px;
}

我不太确定问题是什么,因为我以前使用过地图并且它们总是有效,所以我唯一的事情就是我想到的是 CSS 与它有某种冲突。如果我正在查看错误的 CSS,并且另一个标签会导致问题,我也可以发布该问题。 现在我正在 IE 中查看此内容(我还没有下载 FF,但我会下载),所以我不知道这是否也是一个问题。

For a website I am making for my job, I wanted to use mostly CSS coding, but when I saw all the issues involving CSS maps I took the advice of others and stuck with the traditional HTML style of maps. However, the mapping code wont work, the links remain unclickable. I'm not sure if this is an issue with the CSS/HTML combination or not, but my code is as follows for the HTML part:

<body>
<div id="header">
    <div id="menu">
        <img src="http://i74.photobucket.com/albums/i266/nanashiwolf/header.png" width="770" height="100" alt="logo" border="0" usemap="#headermap" />

<map name="#headermap">
  <area shape="rect" coords="156,67,156,83,225,83,225,67" href="links.html" alt="Links" />
  <area shape="rect" coords="239,67,239,83,309,83,309,67" href="links.html" alt="Links" />
  <area shape="rect" coords="324,67,324,83,392,83,392,67" href="links.html" alt="Links" />
  <area shape="rect" coords="403,67,403,83,511,83,511,67" href="links.html" alt="Links" />
  <area shape="rect" coords="526,67,526,83,588,83,588,67" href="links.html" alt="Links" />
  <area shape="rect" coords="602,67,602,83,662,83,662,67" href="links.html" alt="Links" />
  <area shape="rect" coords="675,67,675,83,736,83,736,67" href="links.html" alt="Links" />
</map>
    </div></div>

Following that immediately is another open div for the body of the website, and far as I know there are no issues with that. I was thining maybe it was an issue with the menu tag, but this is all I have for menu:

#menu {

    float: left;
    width: 767px;
    height: 200px;
}

I'm not really sure what the problem is because I've used maps before and they always work, so the only thing I'm thinking of is the CSS is conflicting it somehow. If I'm looking at the wrong CSS though and another tag would be causing the problem I can post that as well.
Right now I'm viewing this in IE (I havent yet downloaded FF but I will), so I dont know if that could also be an issue.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

妥活 2024-12-18 05:33:49

地图 name 参数中不应包含 #

<map name="headermap">

仅在 usemap 指令中才需要:

<img usemap="#headermap">

通过将 # 放入地图名称中,您实际上必须使用 usemap="##headermap" 来代替。

The map name parameter shouldn't have a # in it:

<map name="headermap">

It's only necessary in the usemap directive:

<img usemap="#headermap">

By putting # into the map's name, you'd actually have to use usemap="##headermap" instead.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文