0
SVG Rectangle
Rectangle has the tag <rect attributes /> right! Why did they show <rect attributes> <animate /></rect>?
4 Answers
+ 3
SVG stands for Scalable Vector Graphics. The course is teaching you to animate not just to draw a rectangle hence the animate tag. Tho probably the svg tag would be more appropriate.
+ 3
âWell this particular code they show should work without closing the rect tag because it doesn't need to be closed. However if you want to put another shape in after the animation tag you absolutely need to close the rect tag or the other shape will not be displayed. The reason being it takes anything written after the animation tag as part of the rect if you don't close it.
+ 1
In fact in the first form, 'rect' was used with an end tag, but shortcut form:
<rect attributes />
is equivalent to:
<rect attributes></rect>
meaning that the tag has no child node content ( is empty )...
To use an <animate> node applied to the <rect> node, we must put it as child, needing to develop the shortcut form ^^
0
my question was, why did rect have an end tag?... initially rect was used without an end tag