Excerpt from: http://www.w3school.com.cn/html5/html_5_canvas_vs_svg.asp
If you knew it before, it would be less difficult to understand, and you would be able to read the code quickly and then from imitation to innovation. Although technology does require brain power, it accumulates a lot.
It's going to be different.
Both Canvas and SVG allow you to create graphics in your browser, but they are fundamentally different.
Svg
SVG is a language that uses XML to describe 2D graphics.
SVG is based on XML, which means that every element in the SVG DOM is available. You can attach a JavaScript event handler to an element.
In SVG, each drawn shape is treated as an object. If the properties of the SVG object change, the browser can automatically reproduce the graphic.
Canvas
Canvas uses JavaScript to draw 2D graphics.
The Canvas is rendered per pixel.
In the canvas, once the drawing is drawn, it will not continue to get the attention of the browser. If its position changes, the entire scene also needs to be redrawn, including any objects that might have been overwritten by the graphic.
Comparison of Canvas and SVG
The following table lists some of the differences between canvas and SVG.
Canvas
Dependent resolution
Event handlers are not supported
Weak text rendering capabilities
Ability to save result images in. png or. jpg format
Best for image-intensive games where many of the objects are redrawn frequently
Svg
Not dependent on resolution
Support for event handlers
Best for applications with large rendering areas (e.g. Google Maps)
High complexity slows rendering speed (any applications that overuse the DOM are unpleasant)
Not suitable for gaming applications
HTML 5 Canvas vs. SVG (excerpt)