开发者

place SVG over html elements

开发者 https://www.devze.com 2023-03-18 03:39 出处:网络
I am using SVG for some chart. But i have problem with svg popup window. As you开发者_开发百科 can see on the picture html div(green bar) overlaps black popup. Is there any way to place svg over html

I am using SVG for some chart. But i have problem with svg popup window. As you开发者_开发百科 can see on the picture html div(green bar) overlaps black popup. Is there any way to place svg over html elements(over green bar in my case )?


in ie9 same page is ok.

enter image description here

enter image description here


The issue here doesn't just apply to SVGs. It's to do with element positioning. Any positioned elements (position:absolute, position:relative) are displayed in front of any non-positioned elements.

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

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

<div class="box red">
</div>


It is certainly possible to place SVG over HTML elements (see this example).

I'm afraid I can't see your image due to firewall :(

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号