So if I understand z-index correctly, it would be perfect in this situation:
z-index
Your elements need to have a position attribute. (e.g. absolute, relative, fixed) or z-index won't work.
position
absolute
relative
fixed