将SVG放在html元素上

Nei*_*ir0 4 html svg

我正在使用SVG获取某些图表.但我有svg弹出窗口的问题.正如你在图片上看到的html div(绿色条)重叠黑色弹出窗口.有没有办法将svg放在html元素上(在我的情况下在绿色栏上)?


在ie9相同的页面是好的.

在此输入图像描述

在此输入图像描述

Ian*_*anS 9

这里的问题不仅适用于SVG.这与元素定位有关.任何定位元素(位置:绝对,位置:相对)显示在任何未定位元素的前面.

.box{ width: 200px; height: 200px; }

.blue{
  background-color: blue;
  position: absolute;
  
}
.red{
  background-color: red;
  //position: relative; /*see what happens when you remove this*/
}
Run Code Online (Sandbox Code Playgroud)
<div class="box blue">
</div>

<div class="box red">
</div>
Run Code Online (Sandbox Code Playgroud)


El *_*oco 6

将 SVG 置于 HTML 元素之上当然是可能的(请参阅此示例)。

由于防火墙的原因,恐怕我看不到您的图像:(