Z-index is invalid when canvas width is greater than parent width

z-index fails when canvas width is greater than parent width
when doing a mobile web page, it is found that
canvas has the same settings width/height and parent

in css style.

z-index failure canvas is always on top
canvas width/height is set to 300 when canvas width/height is set to 600 in line. What is the problem with z-index?

Jun.17,2022
Menu