SivaRajini
SivaRajini

Reputation: 7375

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

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

Upvotes: 0

Views: 5445

Answers (1)

Jake Wilson
Jake Wilson

Reputation: 91213

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.

Upvotes: 3

Related Questions