Why is an element overlapping another element I designed to be in foreground with z-index? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Why is an element overlapping another element I designed to be in foreground with z-index?

Hi there, I created two svg elements, a text and a circle. I've put the text element before the circle to get sure it will overlap it. But circle is over instead. Then I used z-index in CSS to fix and it still not work. Could anybody help me to fix that? Thanks a lot in advance! [PRIVATE CODE]

12th Nov 2017, 9:31 PM
Winston-Delbert Gaster
Winston-Delbert Gaster - avatar
2 Answers
+ 4
if you want the <text> to appear on the top of <circle>, you must add it AFTER the circle and NOT before. ...or you can <use xlink:href="#ID_OF_TEXT"/>
12th Nov 2017, 9:40 PM
Nomeh Uchenna Gabriel
Nomeh Uchenna Gabriel - avatar
+ 2
You replied at the exact moment I fixed the issue looking at another code. 😂😂 But thank you very much!!
12th Nov 2017, 9:41 PM
Winston-Delbert Gaster
Winston-Delbert Gaster - avatar