This article mainly introduces the introductory tutorial for using HTML5 to draw SVG vector graphics, including drawing basic graphics and simple gradient effects. Note that the support of the old version of IE is not good. Friends who need it can refer to it.
VG represents scalable vector graphics, a language used to describe 2D graphics, and graphics applications are written in XML, which are then presented by an SVG reader program.
SVG is mainly used for vector type charts, such as pie charts, two-dimensional charts in X, Y coordinate systems, etc.
SVG became the W3C recommended standard on January 14, 2003, and you can view the latest version of the SVG specification on the SVG specification page.
View SVG filesMost web browsers can display SVGs, just as they can display PNG, GIF, and JPG graphics. IE users may need to install the Adobe SVG reader to be able to view SVG in their browser.
Embed SVG in HTML5
HTML5 allows us to embed SVG directly using the __<svg>...</svg> tag. The following is the simple syntax:
XML/HTML Code Copy content to clipboard