in general, the last activated will be on top.
div a is z-index 10, and appears first in the document div b is z-index 10, and appears second in the document
when the document displays b, it will be higher than a because a is written, then b is written on top.
Modification a can bring it on top.
basically you should have a click handler on 'a' to pick it up if you ever need it to appear on top of b.
source share