我正在尝试在 <a>
中使用图像映射标签。它在 chrome 中有效,但在 IE 中无效。
在<a>
中使用图像映射是否可以?标签?
这是我的代码:
<div class="planner_banner">
<a href="xxx">
<img src="xxx" usemap="#planner_banner_map" border="0">
<map name="planner_banner_map">
<area shape="rect" coords="243, 1, 272, 30"
onclick="$('.planner_banner').hide();return false;"/>
</map>
</a>
</div>
最佳答案
Is it okay to use an image map in
<a>
tag?
没有。参见 the specification :
The a element … Content model: Transparent, but there must be no interactive content or a element descendants.
和interactive content定义为:
a (if the href attribute is present) audio (if the controls attribute is present) button details embed iframe img (if the usemap attribute is present) input (if the type attribute is not in the Hidden state) label select textarea video (if the controls attribute is present)
关于javascript - 是否可以在 <a> 标签中使用图像映射?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53862233/