Css 给出一个`<;地图>;`对于背景图像,如何为其部分`<;面积>`s

Css 给出一个`<;地图>;`对于背景图像,如何为其部分`<;面积>`s,css,html,Css,Html,我的backgroundCSS属性设置为400x400图像 它有许多区域,每个区域都指向某个URL: <map ...> <area shape="rect" coords="5, 5, 10, 10" href="http://example.com/1"> <area shape="rect" coords="10, 20, 20, 30" href="http://example.com/2"> ... &l

我的
background
CSS属性设置为400x400图像

它有许多
区域,每个区域都指向某个URL:

   <map ...>
     <area shape="rect" coords="5, 5, 10, 10"   href="http://example.com/1">
     <area shape="rect" coords="10, 20, 20, 30" href="http://example.com/2">
     ...
   </map>

...
我想用纯色填充一些区域,使它们模糊背景图像。我以为
会有背景,但这似乎不起作用:

   <map ...>
     <!-- Adding `style="background-color: red"` has no effect. -->
     <area shape="rect" coords="5, 5, 10, 10"   href="http://example.com/1"
       style="background-color: red">

     <area shape="rect" coords="10, 20, 20, 30" href="http://example.com/2">
     ...
   </map>

...
有没有一种方法可以用CSS实现这一点


Edit:存在一些现有但不完全相同的问题,这些问题的答案可能会影响到这一点,但它们要么需要使用jQuery,要么不使用有效的HTML。我要求一个基于CSS的解决方案,如果有的话。

我通过使用
display=block
和specs制作一个
来进行分类。我刚刚尝试为bg颜色添加一个内联CSS,它成功了。它将被链接(至少到目前为止),但它只能用HTML CSS来完成工作。

据我所知,没有。不过,请检查一下另一种方法-->@SRing-Hmm--这个答案似乎不是有效的HTML,因为作者推荐
div(set position:[sic]absolute)
,我一点也不清楚这意味着什么,也不清楚
div
与您的
区域相关的位置。提出的解决方案是替换您的
@SRing:谢谢您的建议。我会再尝试一次,但我真的在寻找只涉及CSS和HTML的解决方案;我不希望仅仅为了这一点就在我的整个网站上添加依赖项。另一个选择。。。