简体   繁体   中英

html layering with canvas and table

I am using z-index to keep track of layers. But once the canvas updates using stroke() the layering gets messed up and the table that holds the smaller circles is drawn over.

#canvas{z-index:1; display: div; display: table}
table.center{x-index:2;}

Am I missing any properties or is there another fix? thanks.

I believe that because HTML5 causes the canvas to redraw that part of the screen, it overrides any z-index modifier you have. You may also need to redraw the smaller circles, after redrawing the larger first.

I try to think of it like painting a wall in real life - you have to paint in order, one thing at a time.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM