Answer the question
In order to leave comments, you need to log in
How to set viewbox for tag, svg?
Good afternoon! Can you please tell me how to set a viewbox or something for the svg tag?
The problem is that there is such markup.
<g><circle cx="10" cy="10" r="4" stroke-width: 0;"></circle></g>
Answer the question
In order to leave comments, you need to log in
let svg = document.getElementsByTagName('svg')[0];
svg.setAttribute('viewBox',"0 0 400 400");
<g transform="translate(2,2)"><circle cx="10" cy="10" r="4" stroke-width="0"></circle></g>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question