+ 3
Why we using height and width within svg as well as in rect. What is the difference??
2 Answers
+ 2
The <svg> element establishes a viewport for the content of the SVG canvas.
By specifying a width and height to the <svg>, you restrict the content inside it to the bounds of the viewport that is defined by the x, y, width, and height attributes.
Rect is an object inside the canvas so you must give it an attribute.
+ 2
Yeah now i got it. Svg height and width is like viewport in computer graphics.