jquery - 如何使用 css 定位 html 区域 map

标签 jquery css

我想用 CSS 隐藏这个区域 map 。如何在不向其或周围添加额外元素的情况下做到这一点?

<map name="planetmap">
  <area shape="rect" coords="0,0,82,126" alt="Sun" href="sun.htm">
  <area shape="circle" coords="90,58,3" alt="Mercury" href="mercur.htm">
  <area shape="circle" coords="124,58,8" alt="Venus" href="venus.htm">
</map>

最佳答案

可以单独使用pointer-events(Firefox不采用map和area标签的显示规则)

/* use the selector of your needs : 
img[usemap] or img[usemap="#planetmap"]
*/
img {
  pointer-events:none;
  }
<img src="http://www.w3schools.com/tags/planets.gif" width="145" height="126" alt="Planets" usemap="#planetmap">
<h1>map is disabled</h1>
<map name="planetmap">
  <area shape="rect" coords="0,0,82,126" alt="Sun" href="sun.htm">
  <area shape="circle" coords="90,58,3" alt="Mercury" href="mercur.htm">
  <area shape="circle" coords="124,58,8" alt="Venus" href="venus.htm">
</map>

关于jquery - 如何使用 css 定位 html 区域 map ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28596183/

相关文章:

javascript - 如何使可拖动元素内的元素可点击?

javascript - 需要关闭下拉点击点击 body

javascript - 使用 jquery 面对代码问题创建返回顶部按钮

html - Bootstrap 专栏全部内容背景色

javascript - Bootstrap 导航栏会展开但不会折叠

HTML .png 图像作为按钮形状

jquery - 单独选中自定义复选框

jquery - 如何使用 jQuery 将一个 HTML block 替换为另一个 HTML block

jquery - 在嵌套函数中传递父函数参数?

jQuery - 等待元素关闭