The HTML <svg> element is a container for SVG graphics. SVG stands for Scalable Vector Graphics. SVG and useful for defining graphics such as boxes, circles, text, etc. SVG stands for Scalable Vector Graphics and is a language for describing 2D-graphics and graphical applications in XML and the XML is then rendered by an SVG viewer. Most of the web browsers can display SVG just like they can display PNG, GIF, and JPG.
The HTML <canvas> element is used to draw graphics, via JavaScript. The<canvas> element is a container for graphics.
you can try to run the following code to add scalable vector graphics (SVG) to web page −
You can try to run the following code to learn how to draw a rectangle with HTML5 Canvas −