Nested CANVAS elements

后端 未结 4 1125
孤街浪徒
孤街浪徒 2021-01-17 12:14

Is it possible to have a element within another element? I know i can layer them, but is this possible -


    

        
4条回答
  •  没有蜡笔的小新
    2021-01-17 12:54

    If you want to handle background and foreground separately, you could use two canvas and put one above the other with css.

    
    
    
    
    

    Actually this one of the tips to improve canvas performance. Source: HTML5 Rocks

提交回复
热议问题