what is the difference between SVG size definition and the object's size? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

what is the difference between SVG size definition and the object's size?

Answer

14th Oct 2018, 8:08 PM
Afonne-CID Paul Onyedikachi
4 Answers
+ 1
You mean the width and height of the SVG vs the width and height of the shapes or graphic it contains?
18th Oct 2018, 10:26 PM
Umeozulu Tochukwu
Umeozulu Tochukwu - avatar
+ 1
Okay. From my understanding, the width and height attributes of the <svg> element defines the visible portion at a time of the svg while that of the shapes (rect for instance) defines the size graphic itself. For instance, let's say I draw a <rect> that is 200px high and wide, while the <svg> is 100px high and wide. This can be interpreted as me trying to see a huge house (the shapes which are 200px high and wide) through a window (the svg which is 100px high and wide). But in this case, the house is not far away but at the same distance from you as the window.
18th Oct 2018, 11:01 PM
Umeozulu Tochukwu
Umeozulu Tochukwu - avatar
+ 1
Thank you really very much
19th Oct 2018, 5:16 AM
Afonne-CID Paul Onyedikachi
0
Yes sir, why state SVG height & width and the also the shapes width & height? Isn't the SVG going to be the size of the shape/object we want to create? Hope you understood my quest...
18th Oct 2018, 10:37 PM
Afonne-CID Paul Onyedikachi