What is the difference between polygon and path? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What is the difference between polygon and path?

What is the difference between SVG polygon and path?

18th Jan 2017, 10:42 PM
Maxim Velichkin
Maxim Velichkin - avatar
3 Answers
+ 9
Both can create shapes. Polygon will automatically close the shape for you (by returning to the first point) after drawing at least three sides, and is composed of a series of connected straight lines, which means it does not scale well. Paths can use straight OR curved lines, and do not auto-close the shape for you. Path is probably the most powerful basic shape element in SVG.
19th Jan 2017, 4:34 AM
James McCoy
James McCoy - avatar
+ 3
Polygon syntax is also a little soberest than the polygone one...
19th Jan 2017, 7:11 AM
visph
visph - avatar
+ 1
Thank you very much!
19th Jan 2017, 6:34 PM
Maxim Velichkin
Maxim Velichkin - avatar