What is difference between<canvas> and <svg> in html? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

What is difference between<canvas> and <svg> in html?

24th Mar 2021, 4:48 PM
Aditya Janjanam
Aditya Janjanam - avatar
3 Answers
+ 3
Hey there Janjanam Aditya, Just go through this lesson and you'll clarify your doubts :D https://www.sololearn.com/learn/HTML/2202/?ref=app
24th Mar 2021, 4:50 PM
Matthew
Matthew - avatar
+ 3
canvas: bitmap graphics (2d or 3d) svg: vector graphics (almost 2d, even if you could implement 3d using js)
24th Mar 2021, 4:53 PM
visph
visph - avatar
+ 3
The<canvas> element is a container for graphics. SVG gives better performance with smaller number of objects or larger surface. Canvas gives better performance with smaller surface or larger number of objects. SVG is vector based and composed of shapes.
24th Mar 2021, 6:00 PM
xJAYOx
xJAYOx - avatar