0
What's the difference between using svg width and height & rect height width bcos when both changed acc to need gvs same result
6 Answers
+ 8
Try this-
<svg style='border:2px solid black;' width="300" height="200">
<rect width="200" height="100"
x="20" y="20" fill="green" />
</svg>
+ 8
Please prefer SVG vs Canvas in HTML course given in SoloLearn.
+ 6
Don't say canvas,
SVG is the area of SVG đ
and yes, rect is the area of figure.
+ 3
Both attributes change the size of the HTML item they stand next to. If you set the height/width of svg space and then create a rect larger that this space, any change in size parameters between runs - also because both items are of the same shape which could be confusing - will make you think that there is no difference.
In reality there is - either you change the size of an object (rectangle in this case) or the size of the drawing space as a whole (svg).
Try to change the object to circle to notice the difference right away :)
0
Ohk cool so svg is the area of canvas and rect is the area of our figure
0
Ohk m sorry then say me what is canvas