Jump to content

Search In
  • More options...
Find results that contain...
Find results in...

z-index in svg element

Recommended Posts

hi guys

i want mask svg element on some gsap animation.


i want red element in svg goes top of pricebox div,i set z-index for it but wont work ???

anyone can help me ?





See the Pen OJPBpxa by abbecipher (@abbecipher) on CodePen

Share this post

Link to post
Share on other sites

Hey abbe and welcome.


Please do not try to mention/ping random users. Just post your question and most likely someone will answer it :) 


Z index cannot work with SVG elements. The only thing that determines layering within an SVG is the order in which the elements are placed with the later ones being put on top.


I'm sorry but I don't understand what you're trying to do in that demo. Can you please describe your goal more clearly and remove any parts of it that are unrelated to your question?

  • Like 1

Share this post

Link to post
Share on other sites

thanks for your response @ZachSaucier.i remove that mention.


i have a div box ( price box) and i want animate it on switch toggle change to svg box element below  it.

this is animation step :


1.open box

2. move pricebox to y axis (down in to box hole)

3. close that box again.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.