+ 1
What cx,cy do? I couldn't really understand
What x,y do in rect tag?
2 Answers
+ 2
x and y are left and top coordinates of a rectangle in a rect element.
For a circle, cx and cy are coordinates of the centre of the circle.
I suggest you create a simple svg file that shows a circle and a rect and load it in a web browser. Change the x, y, cx, and cy values, save, and reload in browser until you see what affect they have on what you see.
Here is a starting point for you:
<?xml version="1.0" encoding="UTF-8" ?>
<svg
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 846 557"
width="846"
height="557"
>
<circle cx="185" cy="35" r="26.5" stroke="#000" stroke-width="17"/>
<rect x="262" y="53" width="40" height="17" style="fill:#f00"/>
</svg>
+ 1
Thanks. I understood