Baidu Encyclopedia:
SVG Scalable Vector Graphics (Scalable vector Graphics) is a graphical format for describing two-dimensional vector graphics based on Extensible Markup Language (XML). SVG is a new two-dimensional vector graphic format and a standard of network vector graphics in the standard. SVG strictly conforms to XML syntax and uses descriptive language in text format to describe image content, so it is a vector graphic format independent of image resolution.
What is SVG?
SVG refers to scalable vector graphics (Scalable vector Graphics)
SVG is used to define vector based graphics for the network
SVG uses XML format to define graphics
SVG images will not lose their graphic quality when zooming in or changing size
SVG is the standard of the World Wide Web Consortium
SVG and the standards of the global consortium, such as DOM and XSL, are a whole
The difference between Canvas and SVG:
Svg
SVG is a language that uses XML to describe 2D graphics.
SVG is xml-based, which means that every element in the SVG DOM is available. You can attach a JavaScript event handler for an element.
In SVG, each drawn graphic is treated as an object. If the properties of the SVG object change, the browser can reproduce the graphic automatically.
Characteristics:
Non-dependent resolution
Support Event handlers
Best for applications with large rendering areas (Google Maps, for example)
High complexity slows down rendering (any application that uses DOM too much is not fast)
Not suitable for game application
Canvas
Canvas uses JavaScript to draw 2D graphics.
Canvas is rendered in pixels.
In canvas, once the graphic has been drawn, it will not continue to get the attention of the browser. If its position changes, the entire scene needs to be redrawn, including any object that may have been covered by the graphic.
Characteristics:
Dependent resolution
Event Processor not supported
Weak text rendering capabilities
Ability to save the resulting image in. png or. jpg format
Ideal for image-intensive games, where many of the objects are frequently redrawn
SVG Example:
The code is as follows:
<svg width= "100%" height= "100%" >
<circle cx= "cy=" r= "stroke=" "#ff0" stroke-width= "3" fill= "Red"/>
</svg>