+ 1
THE PATH ELEMENT (SVG)
How do I place an object drawn with the path element to the center of the page. Is it appropriate to make use of the <p = align “center”> tag? Here’s a the code..... <svg width="500" height="500"> <path d="M 0 0 L200 200 L200 50 Z" style="stroke:#000; fill:none;" /> </svg>
4 Respostas
+ 2
<!DOCTYPE html>
<html>
<head>
<title>Example code for James Abirola Bisiriu</title>
</head>
<body style="text-align:center;">
<svg height="500" width="500">
<path d="M 0 0 L 200 200 L 200 50 Z" stroke="#000" fill="none"></path>
</svg>
</body>
</html>
The question is what if I have lots code and I want just the contents of the SVG to be centralized in the page, how do I code that, seeing this code makes all the contents of the page to be centralized.
0
Do you mean text-align:center? Then it would fit if you set the svg's parent element to text-align:center.
0
It doesn’t seem to work, could write it out as a working code maybe it could help
0
Like this
https://code.sololearn.com/WEekI2dD7k46/