Z-order and z-index in SVG for particular group or element

你说的曾经没有我的故事 提交于 2019-12-13 04:29:51

问题


i drawn one line in SVG using "path" tag and then i drawn circle on the same x value of line but the circle is behind the line. i want the circle element in front of line. how to set z-order or z-index to particular group or element in svg to display the element in front.

i tried z-Index attribute to circle but its not working .

<circle  .... z-Index=1000>

</circle>

Thanks,

Siva


回答1:


SVG elements do not have a z-index that you can adjust. Their layering order is dependent on what order you draw them in the HTML. Moving an SVG object to the top, for example, is a matter of removing it from the DOM and appending it to the object's parent. Since it is the most recently drawn SVG object, it will therefore be shown on top.



来源:https://stackoverflow.com/questions/16331101/z-order-and-z-index-in-svg-for-particular-group-or-element

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!