+ 8
What is the use of width and height attributes of svg tag?
<svg width="400" height="410"> <line x1="10" y1="10" x2="200" y2="100" style="stroke:#000000; stroke-linecap:round; stroke-width:20" /> </svg> I have changed the value of width and height but nothing changed in the result so why will we use them?
2 Respuestas
+ 5
height and width defines the area in which line is drawing
modify the code
width=100% height=100% and also points i.e value of x2 and y2 and see the difference
0
Some browsers also have problems in displaying the image when only one dimension is set. Be safe and always set width AND height.